Skip to content

Commit 92ee9a0

Browse files
committed
fix unit test
1 parent 7f4caa4 commit 92ee9a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sonic-config-engine/tests/test_minigraph_case.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import subprocess
3-
import ipaddress
3+
import ipaddr as ipaddress
44

55
import tests.common_utils as utils
66

@@ -181,12 +181,12 @@ def test_parse_device_desc_xml_mgmt_interface(self):
181181
self.assertEqual(len(mgmt_intf.keys()), 2)
182182
self.assertTrue(('eth0', '10.0.0.100/24') in mgmt_intf.keys())
183183
self.assertTrue(('eth0', 'FC00:1::32/64') in mgmt_intf.keys())
184-
self.assertTrue(ipaddress.ip_address(u'10.0.0.1') == mgmt_intf[('eth0', '10.0.0.100/24')]['gwaddr'])
185-
self.assertTrue(ipaddress.ip_address(u'fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr'])
184+
self.assertTrue(ipaddress.IPAddress('10.0.0.1') == mgmt_intf[('eth0', '10.0.0.100/24')]['gwaddr'])
185+
self.assertTrue(ipaddress.IPAddress('fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr'])
186186

187187
# Special device_desc.xml with IPv6 mgmt address only
188188
result = minigraph.parse_device_desc_xml(self.sample_simple_device_desc_ipv6_only)
189189
mgmt_intf = result['MGMT_INTERFACE']
190190
self.assertEqual(len(mgmt_intf.keys()), 1)
191191
self.assertTrue(('eth0', 'FC00:1::32/64') in mgmt_intf.keys())
192-
self.assertTrue(ipaddress.ip_address(u'fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr'])
192+
self.assertTrue(ipaddress.IPAddress('fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr'])

0 commit comments

Comments
 (0)