diff options
author | George Burgess IV <gbiv@google.com> | 2024-04-24 14:50:01 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-04-29 15:24:39 +0000 |
commit | f93589bb7b82b5749380bec3eb4c66db862ee8dd (patch) | |
tree | cdccb80b38b3f8c82981c7bbcff005504d39d16d /crosperf/config_unittest.py | |
parent | cb5995d713ec1baa36254de6b482a61ee7783175 (diff) | |
download | toolchain-utils-f93589bb7b82b5749380bec3eb4c66db862ee8dd.tar.gz |
move *unittest.py to *test.py
pytest only automatically runs the latter. There's likely a way to
change the test filter, but uniformity is probably better?
This also renames the seccomp editor test, since that wasn't being
picked up properly.
BUG=b:336823685
TEST=Ran pytest
Change-Id: I39325c6427916ffcb6c736f430c28407048ad766
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5484681
Commit-Queue: George Burgess <gbiv@chromium.org>
Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf/config_unittest.py')
-rwxr-xr-x | crosperf/config_unittest.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/crosperf/config_unittest.py b/crosperf/config_unittest.py deleted file mode 100755 index fdff7ea6..00000000 --- a/crosperf/config_unittest.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# 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""" - - -import unittest - -import config - - -class ConfigTestCase(unittest.TestCase): - """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) - - # 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") - - # 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) - - # 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) - - -if __name__ == "__main__": - unittest.main() |