summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYoshihiro Kaneko <ykaneko0929@gmail.com>2014-05-14 12:34:46 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-05-14 13:20:58 +0900
commitbd61cd5dd18d22bbdbfb67c34c13feae7a732204 (patch)
treeb102e46ba6ae58550784d0344cd35a924c7e3e61
parentc468fdd12675ff478636f8b803a1be1937afd404 (diff)
tests: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/tests/integrated/test_request_reply_v12.py4
-rw-r--r--ryu/tests/integrated/vrrp_common.py8
-rw-r--r--ryu/tests/switch/tester.py8
-rwxr-xr-xryu/tests/test_lib.py6
4 files changed, 13 insertions, 13 deletions
diff --git a/ryu/tests/integrated/test_request_reply_v12.py b/ryu/tests/integrated/test_request_reply_v12.py
index ab999296..224922ca 100644
--- a/ryu/tests/integrated/test_request_reply_v12.py
+++ b/ryu/tests/integrated/test_request_reply_v12.py
@@ -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)
diff --git a/ryu/tests/integrated/vrrp_common.py b/ryu/tests/integrated/vrrp_common.py
index 6ab48e69..9650c339 100644
--- a/ryu/tests/integrated/vrrp_common.py
+++ b/ryu/tests/integrated/vrrp_common.py
@@ -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
diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py
index 0cde1fda..a6734ce9 100644
--- a/ryu/tests/switch/tester.py
+++ b/ryu/tests/switch/tester.py
@@ -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])
diff --git a/ryu/tests/test_lib.py b/ryu/tests/test_lib.py
index 77d5a276..180b236b 100755
--- a/ryu/tests/test_lib.py
+++ b/ryu/tests/test_lib.py
@@ -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()