From ab49d75a45a97615bdfe78aba50f731e757e6b4b Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Tue, 30 Dec 2014 00:14:49 +0100 Subject: [PATCH] tests: Fix outstanding flake8 errors in tests --- mopidy/config/types.py | 4 ++-- mopidy/mpd/protocol/__init__.py | 8 ++++---- tests/config/test_schemas.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mopidy/config/types.py b/mopidy/config/types.py index cd3905ac..bed03fa2 100644 --- a/mopidy/config/types.py +++ b/mopidy/config/types.py @@ -25,8 +25,8 @@ def encode(value): class ExpandedPath(bytes): - def __new__(self, original, expanded): - return super(ExpandedPath, self).__new__(self, expanded) + def __new__(cls, original, expanded): + return super(ExpandedPath, cls).__new__(cls, expanded) def __init__(self, original, expanded): self.original = original diff --git a/mopidy/mpd/protocol/__init__.py b/mopidy/mpd/protocol/__init__.py index 38fcb33a..ff04d435 100644 --- a/mopidy/mpd/protocol/__init__.py +++ b/mopidy/mpd/protocol/__init__.py @@ -36,7 +36,7 @@ def load_protocol_modules(): music_db, playback, reflection, status, stickers, stored_playlists) -def INT(value): +def INT(value): # noqa: N802 """Converts a value that matches [+-]?\d+ into and integer.""" if value is None: raise ValueError('None is not a valid integer') @@ -44,7 +44,7 @@ def INT(value): return int(value) -def UINT(value): +def UINT(value): # noqa: N802 """Converts a value that matches \d+ into an integer.""" if value is None: raise ValueError('None is not a valid integer') @@ -53,14 +53,14 @@ def UINT(value): return int(value) -def BOOL(value): +def BOOL(value): # noqa: N802 """Convert the values 0 and 1 into booleans.""" if value in ('1', '0'): return bool(int(value)) raise ValueError('%r is not 0 or 1' % value) -def RANGE(value): +def RANGE(value): # noqa: N802 """Convert a single integer or range spec into a slice ``n`` should become ``slice(n, n+1)`` diff --git a/tests/config/test_schemas.py b/tests/config/test_schemas.py index f9e64b9b..8412b899 100644 --- a/tests/config/test_schemas.py +++ b/tests/config/test_schemas.py @@ -97,7 +97,7 @@ class LogLevelConfigSchemaTest(unittest.TestCase): class DidYouMeanTest(unittest.TestCase): - def testSuggestoins(self): + def test_suggestions(self): choices = ('enabled', 'username', 'password', 'bitrate', 'timeout') suggestion = schemas._did_you_mean('bitrate', choices)