From a7bd5c448a6eda8b3d841f2dd5c73ed3956fe3c3 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 31 Aug 2012 18:28:12 -0700 Subject: Fix pylint complaints. --- tests/unittests/helpers.py | 3 ++- tests/unittests/test_filters/test_launch_index.py | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'tests') 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) -- cgit v1.2.3