tests: fix pep8

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yoshihiro Kaneko 2014-05-14 12:34:46 +09:00 committed by FUJITA Tomonori
parent c468fdd126
commit bd61cd5dd1
4 changed files with 13 additions and 13 deletions

View File

@ -547,7 +547,7 @@ class RunTest(tester.TestFlowBase):
match = dp.ofproto_parser.OFPMatch()
match.set_dl_dst('\xff' * 6)
table_id=3
table_id = 3
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY,
actions=[action], table_id=table_id, match=match)
@ -567,7 +567,7 @@ class RunTest(tester.TestFlowBase):
match = dp.ofproto_parser.OFPMatch()
match.set_dl_dst('\xee' * 6)
priority = 100
table_id=2
table_id = 2
self.mod_flow(dp, command=dp.ofproto.OFPFC_MODIFY_STRICT,
actions=[action], table_id=table_id,
match=match, priority=priority)

View File

@ -125,7 +125,7 @@ class VRRPCommon(app_manager.RyuApp):
_PRIMARY_IP_ADDRESS0,
self._IFNAME0,
vrid)
assert not rep0.instance_name is None
assert rep0.instance_name is not None
l[0] = rep0
prio = max(vrrp.VRRP_PRIORITY_BACKUP_MIN,
min(vrrp.VRRP_PRIORITY_BACKUP_MAX, 256 - vrid))
@ -134,7 +134,7 @@ class VRRPCommon(app_manager.RyuApp):
_PRIMARY_IP_ADDRESS1,
self._IFNAME1,
vrid)
assert not rep1.instance_name is None
assert rep1.instance_name is not None
l[1] = rep1
instances[vrid] = l
@ -143,12 +143,12 @@ class VRRPCommon(app_manager.RyuApp):
rep0 = self._configure_vrrp_router(vrrp_version, priority,
_PRIMARY_IP_ADDRESS0,
self._IFNAME0, _VRID)
assert not rep0.instance_name is None
assert rep0.instance_name is not None
l[0] = rep0
rep1 = self._configure_vrrp_router(
vrrp_version, vrrp.VRRP_PRIORITY_BACKUP_DEFAULT,
_PRIMARY_IP_ADDRESS1, self._IFNAME1, _VRID)
assert not rep1.instance_name is None
assert rep1.instance_name is not None
l[1] = rep1
instances[_VRID] = l

View File

@ -86,7 +86,7 @@ INTERVAL = 1 # sec
WAIT_TIMER = 3 # sec
CONTINUOUS_THREAD_INTVL = float(0.01) # sec
CONTINUOUS_PROGRESS_SPAN = 3 # sec
THROUGHPUT_PRIORITY = ofproto_v1_3.OFP_DEFAULT_PRIORITY+1
THROUGHPUT_PRIORITY = ofproto_v1_3.OFP_DEFAULT_PRIORITY + 1
THROUGHPUT_COOKIE = THROUGHPUT_PRIORITY
THROUGHPUT_THRESHOLD = float(0.10) # expected throughput plus/minus 10 %
@ -1224,7 +1224,7 @@ class Test(stringify.StringifyMixin):
# parse 'prerequisite'
prerequisite = []
if not KEY_PREREQ in buf:
if KEY_PREREQ not in buf:
raise ValueError('a test requires a "%s" block' % KEY_PREREQ)
allowed_mod = [KEY_FLOW, KEY_METER]
for flow in buf[KEY_PREREQ]:
@ -1242,7 +1242,7 @@ class Test(stringify.StringifyMixin):
# parse 'tests'
tests = []
if not KEY_TESTS in buf:
if KEY_TESTS not in buf:
raise ValueError('a test requires a "%s" block.' % KEY_TESTS)
for test in buf[KEY_TESTS]:
@ -1253,7 +1253,7 @@ class Test(stringify.StringifyMixin):
KEY_PKT_IN, KEY_TBL_MISS))
test_pkt = {}
# parse 'ingress'
if not KEY_INGRESS in test:
if KEY_INGRESS not in test:
raise ValueError('a test requires "%s" field.' % KEY_INGRESS)
if isinstance(test[KEY_INGRESS], list):
test_pkt[KEY_INGRESS] = __test_pkt_from_json(test[KEY_INGRESS])

View File

@ -207,9 +207,9 @@ class RyuTestResult(result.TextTestResult):
if current_case != self._last_case:
self.stream.writeln(current_case)
self._last_case = current_case
#NOTE(salvatore-orlando):
#slightly changed in order to print test case class
#together with unit test name
# NOTE(salvatore-orlando):
# slightly changed in order to print test case class
# together with unit test name
self.stream.write(
' %s' % str(test.test).ljust(60))
self.stream.flush()