diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:58:35 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:58:35 +0000 |
commit | 983a152aeaa1391c50e5a5b46263aea4d9af7587 (patch) | |
tree | 77dc031614745bb406dbd90cea9a082a1b5cdd54 /crosperf/config_unittest.py | |
parent | 1b38c812789ede0d88389effa290fd29768eb71c (diff) | |
parent | 40214b48188358a80b7478bfff21d4814dd9177c (diff) | |
download | toolchain-utils-983a152aeaa1391c50e5a5b46263aea4d9af7587.tar.gz |
Snap for 10453563 from 40214b48188358a80b7478bfff21d4814dd9177c to mainline-media-swcodec-releaseaml_swc_341711000aml_swc_341619000aml_swc_341513600aml_swc_341312300aml_swc_341312020aml_swc_341111000aml_swc_341011020aml_swc_340922010android14-mainline-media-swcodec-release
Change-Id: If52bc5d90ff434b6c205f53d523060f7437fdc09
Diffstat (limited to 'crosperf/config_unittest.py')
-rwxr-xr-x | crosperf/config_unittest.py | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/crosperf/config_unittest.py b/crosperf/config_unittest.py index 208f44dc..fdff7ea6 100755 --- a/crosperf/config_unittest.py +++ b/crosperf/config_unittest.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2014 The Chromium OS Authors. All rights reserved. +# Copyright 2014 The ChromiumOS Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for config.py""" -from __future__ import print_function import unittest @@ -14,40 +13,40 @@ import config class ConfigTestCase(unittest.TestCase): - """Class for the config unit tests.""" + """Class for the config unit tests.""" - def test_config(self): - # Verify that config exists, that it's a dictionary, and that it's - # empty. - self.assertTrue(isinstance(config.config, dict)) - self.assertEqual(len(config.config), 0) + def test_config(self): + # Verify that config exists, that it's a dictionary, and that it's + # empty. + self.assertTrue(isinstance(config.config, dict)) + self.assertEqual(len(config.config), 0) - # Verify that attempting to get a non-existant key out of the - # dictionary returns None. - self.assertIsNone(config.GetConfig('rabbit')) - self.assertIsNone(config.GetConfig('key1')) + # Verify that attempting to get a non-existant key out of the + # dictionary returns None. + self.assertIsNone(config.GetConfig("rabbit")) + self.assertIsNone(config.GetConfig("key1")) - config.AddConfig('key1', 16) - config.AddConfig('key2', 32) - config.AddConfig('key3', 'third value') + config.AddConfig("key1", 16) + config.AddConfig("key2", 32) + config.AddConfig("key3", "third value") - # Verify that after 3 calls to AddConfig we have 3 values in the - # dictionary. - self.assertEqual(len(config.config), 3) + # Verify that after 3 calls to AddConfig we have 3 values in the + # dictionary. + self.assertEqual(len(config.config), 3) - # Verify that GetConfig works and gets the expected values. - self.assertIs(config.GetConfig('key2'), 32) - self.assertIs(config.GetConfig('key3'), 'third value') - self.assertIs(config.GetConfig('key1'), 16) + # Verify that GetConfig works and gets the expected values. + self.assertIs(config.GetConfig("key2"), 32) + self.assertIs(config.GetConfig("key3"), "third value") + self.assertIs(config.GetConfig("key1"), 16) - # Re-set config. - config.config.clear() + # Re-set config. + config.config.clear() - # Verify that config exists, that it's a dictionary, and that it's - # empty. - self.assertTrue(isinstance(config.config, dict)) - self.assertEqual(len(config.config), 0) + # Verify that config exists, that it's a dictionary, and that it's + # empty. + self.assertTrue(isinstance(config.config, dict)) + self.assertEqual(len(config.config), 0) -if __name__ == '__main__': - unittest.main() +if __name__ == "__main__": + unittest.main() |