Module unittesting :: Class TestInterfaceStats
[hide private]
[frames] | no frames]

Class TestInterfaceStats

source code


Tests InterfaceStats class from iface.py

Nested Classes [hide private]

Inherited from unittest.TestCase: failureException

Instance Methods [hide private]
 
testInit(self)
Tests if the object inits correctly.
source code
 
testInitBadSize(self)
Tests if history must have a sane size
source code
 
testInitBadProcFile(self)
Tests if the __init__ method checks for existing proc_net_dev file
source code
 
testIfaceFilterBadType(self)
Tests that two most probable mistakes in the set_iface_filter call raise appropriate exception
source code
 
testGetInterfaces(self)
Test against knows interfaces in the fakeproc file.
source code
 
testGetPrettyName(self)
Test retreiving pretty human-readable names for various ethernet interfaces
source code
 
testThreadWorkerFake(self)
Since the fakeproc file never changes, we will never see the bandwidth rise, just the value in the proc_net_dev file become the "previous".
source code
 
testThreadWorkerReal(self)
This is more advanced test - takes the fakeproc file and appends a known and raising value to the interface metrics in the file, so the resulting history is rising lineary.
source code

Inherited from unittest.TestCase: __call__, __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, setUp, shortDescription, tearDown

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__