summaryrefslogtreecommitdiff
path: root/tests/unittests/test_registry.py
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2022-03-25 20:58:01 +0200
committerzsdc <taras@vyos.io>2022-03-25 21:42:00 +0200
commit31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba (patch)
tree349631a02467dae0158f6f663cc8aa8537974a97 /tests/unittests/test_registry.py
parent5c4b3943343a85fbe517e5ec1fc670b3a8566b4b (diff)
parent8537237d80a48c8f0cbf8e66aa4826bbc882b022 (diff)
downloadvyos-cloud-init-31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba.tar.gz
vyos-cloud-init-31448cccedd8f841fb3ac7d0f2e3cdefe08a53ba.zip
T2117: Cloud-init updated to 22.1
Merged with 22.1 tag from the upstream Cloud-init repository. Our modules were slightly modified for compatibility with the new version.
Diffstat (limited to 'tests/unittests/test_registry.py')
-rw-r--r--tests/unittests/test_registry.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/unittests/test_registry.py b/tests/unittests/test_registry.py
index 2b625026..28ee04ec 100644
--- a/tests/unittests/test_registry.py
+++ b/tests/unittests/test_registry.py
@@ -1,32 +1,33 @@
# This file is part of cloud-init. See LICENSE file for license information.
from cloudinit.registry import DictRegistry
-
-from cloudinit.tests.helpers import (mock, TestCase)
+from tests.unittests.helpers import TestCase, mock
class TestDictRegistry(TestCase):
-
def test_added_item_included_in_output(self):
registry = DictRegistry()
- item_key, item_to_register = 'test_key', mock.Mock()
+ item_key, item_to_register = "test_key", mock.Mock()
registry.register_item(item_key, item_to_register)
- self.assertEqual({item_key: item_to_register},
- registry.registered_items)
+ self.assertEqual(
+ {item_key: item_to_register}, registry.registered_items
+ )
def test_registry_starts_out_empty(self):
self.assertEqual({}, DictRegistry().registered_items)
def test_modifying_registered_items_isnt_exposed_to_other_callers(self):
registry = DictRegistry()
- registry.registered_items['test_item'] = mock.Mock()
+ registry.registered_items["test_item"] = mock.Mock()
self.assertEqual({}, registry.registered_items)
def test_keys_cannot_be_replaced(self):
registry = DictRegistry()
- item_key = 'test_key'
+ item_key = "test_key"
registry.register_item(item_key, mock.Mock())
- self.assertRaises(ValueError,
- registry.register_item, item_key, mock.Mock())
+ self.assertRaises(
+ ValueError, registry.register_item, item_key, mock.Mock()
+ )
+
# vi: ts=4 expandtab