From a50ba6e3a7410db401a6b9d10232de10f40701e7 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Mon, 29 Dec 2014 23:58:36 +0100 Subject: [PATCH] tests: Add noqa markers to custom assert helpers --- tests/mpd/protocol/__init__.py | 10 +++++----- tests/mpd/protocol/test_idle.py | 8 ++++---- tests/mpd/test_tokenizer.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/mpd/protocol/__init__.py b/tests/mpd/protocol/__init__.py index 813d91fe..b9600a1d 100644 --- a/tests/mpd/protocol/__init__.py +++ b/tests/mpd/protocol/__init__.py @@ -50,28 +50,28 @@ class BaseTestCase(unittest.TestCase): self.session.on_receive({'received': request}) return self.connection.response - def assertNoResponse(self): + def assertNoResponse(self): # noqa: N802 self.assertEqual([], self.connection.response) - def assertInResponse(self, value): + def assertInResponse(self, value): # noqa: N802 self.assertIn( value, self.connection.response, 'Did not find %s in %s' % ( repr(value), repr(self.connection.response))) - def assertOnceInResponse(self, value): + def assertOnceInResponse(self, value): # noqa: N802 matched = len([r for r in self.connection.response if r == value]) self.assertEqual( 1, matched, 'Expected to find %s once in %s' % ( repr(value), repr(self.connection.response))) - def assertNotInResponse(self, value): + def assertNotInResponse(self, value): # noqa: N802 self.assertNotIn( value, self.connection.response, 'Found %s in %s' % ( repr(value), repr(self.connection.response))) - def assertEqualResponse(self, value): + def assertEqualResponse(self, value): # noqa: N802 self.assertEqual(1, len(self.connection.response)) self.assertEqual(value, self.connection.response[0]) diff --git a/tests/mpd/protocol/test_idle.py b/tests/mpd/protocol/test_idle.py index 4c987647..3af983e2 100644 --- a/tests/mpd/protocol/test_idle.py +++ b/tests/mpd/protocol/test_idle.py @@ -11,16 +11,16 @@ class IdleHandlerTest(protocol.BaseTestCase): def idleEvent(self, subsystem): self.session.on_idle(subsystem) - def assertEqualEvents(self, events): + def assertEqualEvents(self, events): # noqa: N802 self.assertEqual(set(events), self.context.events) - def assertEqualSubscriptions(self, events): + def assertEqualSubscriptions(self, events): # noqa: N802 self.assertEqual(set(events), self.context.subscriptions) - def assertNoEvents(self): + def assertNoEvents(self): # noqa: N802 self.assertEqualEvents([]) - def assertNoSubscriptions(self): + def assertNoSubscriptions(self): # noqa: N802 self.assertEqualSubscriptions([]) def test_base_state(self): diff --git a/tests/mpd/test_tokenizer.py b/tests/mpd/test_tokenizer.py index b4a1df09..b4d46719 100644 --- a/tests/mpd/test_tokenizer.py +++ b/tests/mpd/test_tokenizer.py @@ -8,10 +8,10 @@ from mopidy.mpd import exceptions, tokenize class TestTokenizer(unittest.TestCase): - def assertTokenizeEquals(self, expected, line): + def assertTokenizeEquals(self, expected, line): # noqa: N802 self.assertEqual(expected, tokenize.split(line)) - def assertTokenizeRaises(self, exception, message, line): + def assertTokenizeRaises(self, exception, message, line): # noqa: N802 with self.assertRaises(exception) as cm: tokenize.split(line) self.assertEqual(cm.exception.message, message)