summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-08-31 18:28:12 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-08-31 18:28:12 -0700
commita7bd5c448a6eda8b3d841f2dd5c73ed3956fe3c3 (patch)
treed75468f396502dc3e7a1fbda2fd268105f9b682b /tests/unittests
parentc2e5c6fd4dc917d2d4fb23569b1615b76c695201 (diff)
downloadvyos-cloud-init-a7bd5c448a6eda8b3d841f2dd5c73ed3956fe3c3.tar.gz
vyos-cloud-init-a7bd5c448a6eda8b3d841f2dd5c73ed3956fe3c3.zip
Fix pylint complaints.
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/helpers.py3
-rw-r--r--tests/unittests/test_filters/test_launch_index.py10
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index 60891191..d0f09e70 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -22,7 +22,8 @@ class ResourceUsingTestCase(MockerTestCase):
if os.path.isdir(p):
self.resource_path = p
break
- self.assertTrue((self.resource_path and os.path.isdir(self.resource_path)),
+ self.assertTrue((self.resource_path and
+ os.path.isdir(self.resource_path)),
msg="Unable to locate test resource data path!")
if not subname:
return self.resource_path
diff --git a/tests/unittests/test_filters/test_launch_index.py b/tests/unittests/test_filters/test_launch_index.py
index c122609a..0c75bf56 100644
--- a/tests/unittests/test_filters/test_launch_index.py
+++ b/tests/unittests/test_filters/test_launch_index.py
@@ -1,6 +1,4 @@
-import os
import copy
-import sys
import helpers as th
@@ -26,7 +24,8 @@ class TestLaunchFilter(th.ResourceUsingTestCase):
def assertCounts(self, message, expected_counts):
orig_message = copy.deepcopy(message)
for (index, count) in expected_counts.items():
- filtered_message = launch_index.Filter(util.safe_int(index)).apply(message)
+ index = util.safe_int(index)
+ filtered_message = launch_index.Filter(index).apply(message)
self.assertEquals(count_messages(filtered_message), count)
# Ensure original message still ok/not modified
self.assertTrue(self.equivalentMessage(message, orig_message))
@@ -50,7 +49,9 @@ class TestLaunchFilter(th.ResourceUsingTestCase):
return False
if m1_msg.is_multipart() != m2_msg.is_multipart():
return False
- if m1_msg.get_payload(decode=True) != m2_msg.get_payload(decode=True):
+ m1_py = m1_msg.get_payload(decode=True)
+ m2_py = m2_msg.get_payload(decode=True)
+ if m1_py != m2_py:
return False
return True
@@ -79,6 +80,7 @@ class TestLaunchFilter(th.ResourceUsingTestCase):
expected_counts = {
5: 1,
-1: 0,
+ 'c': 1,
None: 1,
}
self.assertCounts(message, expected_counts)