Skip to content

Commit b15dc84

Browse files
committed
Small test fixes
1 parent a802e06 commit b15dc84

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def assertIsStrictSubclass(self, klass1, klass2):
3131

3232
def assertIsIpAddress(self, ip):
3333
try:
34-
ipaddress.ip_address(ip)
34+
ipaddress.ip_address(six.text_type(ip))
3535
except ValueError as e:
3636
raise self.failureException(str(e))
3737

test/test_ipconfig.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def do_check(self, thing):
4747
self.assertLessEqual(metric, 1000)
4848
for data in c.RouteData:
4949
self.assertIsIpNetwork(data['dest'], data['prefix'])
50-
self.assertIsIpAddress(data['next-hop'])
50+
if 'next-hop' in data:
51+
self.assertIsIpAddress(data['next-hop'])
5152
self.assertLessEqual(data['metric'], 1000)
5253

5354
if __name__ == '__main__':

0 commit comments

Comments
 (0)