tests: Fix outstanding flake8 errors in tests
This commit is contained in:
parent
627b856578
commit
ab49d75a45
@ -25,8 +25,8 @@ def encode(value):
|
|||||||
|
|
||||||
|
|
||||||
class ExpandedPath(bytes):
|
class ExpandedPath(bytes):
|
||||||
def __new__(self, original, expanded):
|
def __new__(cls, original, expanded):
|
||||||
return super(ExpandedPath, self).__new__(self, expanded)
|
return super(ExpandedPath, cls).__new__(cls, expanded)
|
||||||
|
|
||||||
def __init__(self, original, expanded):
|
def __init__(self, original, expanded):
|
||||||
self.original = original
|
self.original = original
|
||||||
|
|||||||
@ -36,7 +36,7 @@ def load_protocol_modules():
|
|||||||
music_db, playback, reflection, status, stickers, stored_playlists)
|
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."""
|
"""Converts a value that matches [+-]?\d+ into and integer."""
|
||||||
if value is None:
|
if value is None:
|
||||||
raise ValueError('None is not a valid integer')
|
raise ValueError('None is not a valid integer')
|
||||||
@ -44,7 +44,7 @@ def INT(value):
|
|||||||
return int(value)
|
return int(value)
|
||||||
|
|
||||||
|
|
||||||
def UINT(value):
|
def UINT(value): # noqa: N802
|
||||||
"""Converts a value that matches \d+ into an integer."""
|
"""Converts a value that matches \d+ into an integer."""
|
||||||
if value is None:
|
if value is None:
|
||||||
raise ValueError('None is not a valid integer')
|
raise ValueError('None is not a valid integer')
|
||||||
@ -53,14 +53,14 @@ def UINT(value):
|
|||||||
return int(value)
|
return int(value)
|
||||||
|
|
||||||
|
|
||||||
def BOOL(value):
|
def BOOL(value): # noqa: N802
|
||||||
"""Convert the values 0 and 1 into booleans."""
|
"""Convert the values 0 and 1 into booleans."""
|
||||||
if value in ('1', '0'):
|
if value in ('1', '0'):
|
||||||
return bool(int(value))
|
return bool(int(value))
|
||||||
raise ValueError('%r is not 0 or 1' % 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
|
"""Convert a single integer or range spec into a slice
|
||||||
|
|
||||||
``n`` should become ``slice(n, n+1)``
|
``n`` should become ``slice(n, n+1)``
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class LogLevelConfigSchemaTest(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class DidYouMeanTest(unittest.TestCase):
|
class DidYouMeanTest(unittest.TestCase):
|
||||||
def testSuggestoins(self):
|
def test_suggestions(self):
|
||||||
choices = ('enabled', 'username', 'password', 'bitrate', 'timeout')
|
choices = ('enabled', 'username', 'password', 'bitrate', 'timeout')
|
||||||
|
|
||||||
suggestion = schemas._did_you_mean('bitrate', choices)
|
suggestion = schemas._did_you_mean('bitrate', choices)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user