<s> from . import net_stat <EOL> import unittest <EOL> NETWORK_INTERFACE = '<STR_LIT>' <EOL> class TestNetworkStats ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . interface = NETWORK_INTERFACE <EOL> def test_rx_tx_bytes ( self ) : <EOL> rx , tx = net_stat . rx_tx_bytes ( <EOL> self . interface <EOL> ) <EOL> self . assertTrue ( rx >= <NUM_LIT:0> , rx ) <EOL> self . assertTrue ( tx >= <NUM_LIT:0> , tx ) <EOL> def test_rx_tx_bits ( self ) : <EOL> rx , tx = net_stat . rx_tx_bits ( <EOL> self . interface <EOL> ) <EOL> self . assertTrue ( rx >= <NUM_LIT:0> , rx ) <EOL> self . assertTrue ( tx >= <NUM_LIT:0> , tx ) <EOL> def test_rx_tx_dump ( self ) : <EOL> rx , tx = net_stat . rx_tx_bits ( <EOL> self . interface <EOL> ) <EOL> rx , tx = map ( int , ( rx , tx ) ) <EOL> self . assertTrue ( rx >= <NUM_LIT:0> , rx ) <EOL> self . assertTrue ( tx >= <NUM_LIT:0> , tx ) <EOL> def test_invalid_net_interface ( self ) : <EOL> self . assertRaises ( <EOL> net_stat . NetError , <EOL> net_stat . rx_tx_bytes , <EOL> '<STR_LIT>' <EOL> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> test_suite = unittest . TestLoader ( ) . loadTestsFromTestCase ( TestNetworkStats ) <EOL> unittest . TextTestRunner ( verbosity = <NUM_LIT:2> ) . run ( test_suite ) </s>
