def test_non_existent_g(): e = Ethtool('/usr/sbin/ethtool') try: e.ethtool_g('no_such') except NoSuchDevice: print "device not found! (yippee)" else: assert False
def test_ethtool_g(): e = Ethtool('/usr/sbin/ethtool') e.ethtool_g('eth0') print e.g.result