def test_is_present(self): """is_present is True when /sys/net/devname exists.""" self.assertFalse(net.is_present('eth0')) ensure_file(os.path.join(self.sysdir, 'eth0', 'device')) self.assertTrue(net.is_present('eth0'))
def is_present(self, devname: DeviceName) -> bool: return net.is_present(devname)