Assert get_by_name() with non-existent name returns a tuple of None,None

This commit is contained in:
Pim van Pelt
2022-03-22 18:31:03 +00:00
parent 5ecd1ef22c
commit 97fef9bfd2
3 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,9 @@ class TestBondEthernetMethods(unittest.TestCase):
self.assertIn("GigabitEthernet1/0/0", iface['interfaces'])
self.assertNotIn("GigabitEthernet2/0/0", iface['interfaces'])
ifname, iface = bondethernet.get_by_name(self.cfg, "BondEthernet-notexist")
self.assertIsNone(iface)
self.assertIsNone(ifname)
def test_members(self):
self.assertTrue(bondethernet.is_bond_member(self.cfg, "GigabitEthernet1/0/0"))