Skip to content

Commit af37271

Browse files
committed
added .env file for vscode to find test/lib module
replace `is not` exp in *_test.py files to suppress python syntax warning with py3
1 parent a4d5d00 commit af37271

29 files changed

+31
-53
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PYTHONPATH=./test

test/scenario_test/addpath_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def f():
269269

270270
if __name__ == '__main__':
271271
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
272-
if int(output) is not 0:
272+
if int(output) != 0:
273273
print("docker not found")
274274
sys.exit(1)
275275

test/scenario_test/aspath_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
1817
import sys
1918
import time
2019
import unittest
@@ -173,7 +172,7 @@ def f():
173172

174173
if __name__ == '__main__':
175174
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
176-
if int(output) is not 0:
175+
if int(output) != 0:
177176
print("docker not found")
178177
sys.exit(1)
179178

test/scenario_test/bgp_confederation_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
18-
1917
import sys
2018
import time
2119
import unittest
@@ -148,7 +146,7 @@ def test_03_best_path(self):
148146

149147
if __name__ == '__main__':
150148
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
151-
if int(output) is not 0:
149+
if int(output) != 0:
152150
print("docker not found")
153151
sys.exit(1)
154152

test/scenario_test/bgp_malformed_msg_handling_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
1817
import sys
1918
import time
2019
import unittest
@@ -99,7 +98,7 @@ def test_03_treat_as_withdraw(self):
9998

10099
if __name__ == '__main__':
101100
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
102-
if int(output) is not 0:
101+
if int(output) != 0:
103102
print("docker not found")
104103
sys.exit(1)
105104

test/scenario_test/bgp_router_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
1817
import json
1918
import sys
2019
import time
@@ -472,7 +471,7 @@ def test_23_check_withdrawal3(self):
472471

473472
if __name__ == '__main__':
474473
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
475-
if int(output) is not 0:
474+
if int(output) != 0:
476475
print("docker not found")
477476
sys.exit(1)
478477

test/scenario_test/bgp_unnumbered_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
1817
import unittest
1918
from lib import base
2019
from lib.base import BGP_FSM_ESTABLISHED, local
@@ -47,6 +46,7 @@ def setUpClass(cls):
4746
time.sleep(initial_wait_time + 2)
4847

4948
done = False
49+
5050
def f(ifname, ctn):
5151
out = ctn.local('ip -6 n', capture=True)
5252
l = [line for line in out.split('\n') if ifname in line]
@@ -90,7 +90,7 @@ def test_02_add_ipv4_route(self):
9090

9191
if __name__ == '__main__':
9292
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
93-
if int(output) is not 0:
93+
if int(output) != 0:
9494
print("docker not found")
9595
sys.exit(1)
9696

test/scenario_test/bgp_zebra_nht_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def test_07_nexthop_restore(self):
284284

285285
if __name__ == '__main__':
286286
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
287-
if int(output) is not 0:
287+
if int(output) != 0:
288288
print("docker not found")
289289
sys.exit(1)
290290

test/scenario_test/bgp_zebra_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def validate_nexthops(peers):
303303

304304
if __name__ == '__main__':
305305
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
306-
if int(output) is not 0:
306+
if int(output) != 0:
307307
print("docker not found")
308308
sys.exit(1)
309309

test/scenario_test/evpn_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# limitations under the License.
1515

1616

17-
1817
from itertools import combinations
1918
import sys
2019
import time
@@ -144,7 +143,7 @@ def test_04_check_mac_mobility_again(self):
144143

145144
if __name__ == '__main__':
146145
output = local("which docker 2>&1 > /dev/null ; echo $?", capture=True)
147-
if int(output) is not 0:
146+
if int(output) != 0:
148147
print("docker not found")
149148
sys.exit(1)
150149

0 commit comments

Comments
 (0)