def test_non_existent_S(): e = Ethtool('/usr/sbin/ethtool') try: e.ethtool_S('no_such') except NoSuchDevice: print "device not found! (yippee)" else: assert False
def test_ethtool_S(): e = Ethtool('/usr/sbin/ethtool') e.ethtool_S('eth0') print e.S.result