def test_list_all_ifs(): ifs = ifconfig.list_ifs(physical=False) expected = set([b'eth0', b'eth1', b'eth2', b'lo']) assert expected <= set(i.name for i in ifs)
def test_list_ifs_physical_only(): ifs = ifconfig.list_ifs() expected = set([b'eth0', b'eth1', b'eth2']) assert set(i.name for i in ifs) == expected