diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_filters/test_launch_index.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tests/unittests/test_filters/test_launch_index.py b/tests/unittests/test_filters/test_launch_index.py index 0c75bf56..7ca7cbb6 100644 --- a/tests/unittests/test_filters/test_launch_index.py +++ b/tests/unittests/test_filters/test_launch_index.py @@ -4,9 +4,9 @@ import helpers as th import itertools +from cloudinit.filters import launch_index from cloudinit import user_data as ud from cloudinit import util -from cloudinit.filters import launch_index def count_messages(root): @@ -18,7 +18,6 @@ def count_messages(root): return am - class TestLaunchFilter(th.ResourceUsingTestCase): def assertCounts(self, message, expected_counts): @@ -84,7 +83,7 @@ class TestLaunchFilter(th.ResourceUsingTestCase): None: 1, } self.assertCounts(message, expected_counts) - + def testConfigEmailIndex(self): test_data = self.readResource('filter_cloud_multipart_1.email') ud_proc = ud.UserDataProcessor(self.getCloudPaths()) @@ -98,7 +97,7 @@ class TestLaunchFilter(th.ResourceUsingTestCase): None: 1, } self.assertCounts(message, expected_counts) - + def testNoneIndex(self): test_data = self.readResource('filter_cloud_multipart.yaml') ud_proc = ud.UserDataProcessor(self.getCloudPaths()) @@ -107,7 +106,7 @@ class TestLaunchFilter(th.ResourceUsingTestCase): self.assertTrue(start_count > 0) filtered_message = launch_index.Filter(None).apply(message) self.assertTrue(self.equivalentMessage(message, filtered_message)) - + def testIndexes(self): test_data = self.readResource('filter_cloud_multipart.yaml') ud_proc = ud.UserDataProcessor(self.getCloudPaths()) @@ -117,14 +116,14 @@ class TestLaunchFilter(th.ResourceUsingTestCase): # This file should have the following # indexes -> amount mapping in it expected_counts = { - 2:2, - 3:2, - 1:2, - 0:1, - 4:1, - 7:0, - -1:0, - 100:0, + 2: 2, + 3: 2, + 1: 2, + 0: 1, + 4: 1, + 7: 0, + -1: 0, + 100: 0, # None should just give all back None: start_count, # Non ints should be ignored |