Skip to content

Commit

Permalink
Fix some flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Mar 28, 2024
1 parent b48ec14 commit e1c2de7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
18 changes: 12 additions & 6 deletions tools/rdm/TestDefinitions.py
Expand Up @@ -8654,22 +8654,26 @@ class SetBackgroundQueuedStatusPolicyWithNoData(TestMixins.SetWithNoDataMixin,
PID = 'BACKGROUND_QUEUED_STATUS_POLICY'


class SetBackgroundQueuedStatusPolicyWithExtraData(TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
class SetBackgroundQueuedStatusPolicyWithExtraData(
TestMixins.SetWithDataMixin,
OptionalParameterTestFixture):
"""Send a SET BACKGROUND_QUEUED_STATUS_POLICY command with extra data."""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY'


class AllSubDevicesGetBackgroundQueuedStatusPolicyDescription(
TestMixins.AllSubDevicesGetMixin,
OptionalParameterTestFixture):
"""Send a get BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION to ALL_SUB_DEVICES."""
"""Send a get BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION to
ALL_SUB_DEVICES.
"""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'
DATA = [0x00]


# class GetBackgroundQueuedStatusPolicyDescription(TestMixins.,
# OptionalParameterTestFixture):
# class GetBackgroundQueuedStatusPolicyDescription(
# TestMixins.,
# OptionalParameterTestFixture):
# CATEGORY = TestCategory.
# PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'
# TODO(peter): Test get
Expand All @@ -8685,7 +8689,9 @@ class GetBackgroundQueuedStatusPolicyDescriptionWithNoData(
class GetBackgroundQueuedStatusPolicyDescriptionWithExtraData(
TestMixins.GetWithDataMixin,
OptionalParameterTestFixture):
"""GET BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION with more than 1 byte of data."""
"""GET BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION with more than 1 byte of
data.
"""
PID = 'BACKGROUND_QUEUED_STATUS_POLICY_DESCRIPTION'


Expand Down
20 changes: 13 additions & 7 deletions tools/rdm/list_rdm_tests.py
Expand Up @@ -154,14 +154,17 @@ def GetWithExtraData(names, pid, pid_test_base_name, get_size):
dummy_data = GenerateDummyData(get_size)
if dummy_data is None:
print((" #DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (getpass.getuser(), get_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(getpass.getuser(), get_size))
elif dummy_data != 'foo':
# Doesn't match default, explicitly set value
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), get_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(dummy_data, getpass.getuser(), get_size))
else:
print((" #DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), get_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(dummy_data, getpass.getuser(), get_size))
print('')
print('')

Expand Down Expand Up @@ -277,14 +280,17 @@ def SetWithExtraData(names, pid, pid_test_base_name, set_size):
dummy_data = GenerateDummyData(set_size)
if dummy_data is None:
print((" #DATA = b'foo' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (getpass.getuser(), set_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(getpass.getuser(), set_size))
elif dummy_data != 'foo':
# Doesn't match default, explicitly set value
print((" DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), set_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(dummy_data, getpass.getuser(), set_size))
else:
print((" #DATA = b'%s' # TODO(%s): Specify extra data if this isn't "
"enough. Ensure the first %d bytes are sane/valid.") % (dummy_data, getpass.getuser(), set_size))
"enough. Ensure the first %d bytes are sane/valid.") %
(dummy_data, getpass.getuser(), set_size))
print('')
print('')

Expand Down Expand Up @@ -353,7 +359,7 @@ def main():
(pid.GetRequest(PidStore.RDM_GET).HasAtoms())):
for atom in pid.GetRequest(PidStore.RDM_GET).GetAtoms():
get_size += atom.size
#TODO(Peter): Should we just print this total all the time?
# TODO(Peter): Should we just print this total all the time?
if get_size != pid.GetRequest(PidStore.RDM_GET).GetAtoms()[0].size:
print('# Get requires %d bytes' % (get_size))

Expand Down

0 comments on commit e1c2de7

Please sign in to comment.