def test_none_uptime_should_not_crash(self): uptime1 = (0, None) uptime2 = (10, 10) dev = Snmpv2Mib.get_uptime_deviation(uptime1, uptime2) self.assertIsNone(dev)
def test_simple_uptime_deviation_should_be_correct(self): first_uptime = (1338372778.0, 10000) second_uptime = (1338372900.0, 22200) dev = Snmpv2Mib.get_uptime_deviation(first_uptime, second_uptime) assert abs(dev) < 0.5, "deviation is higher than 0.5: %r" % dev
def test_wrapped_uptime_deviation_should_be_correct(self): first_uptime = (1338372778.0, 4294967196L) second_uptime = (1338372900.0, 12100L) dev = Snmpv2Mib.get_uptime_deviation(first_uptime, second_uptime) self.assertTrue(abs(dev) < 0.5, msg="deviation is higher than 0.5: %r" % dev)
def test_wrapped_uptime_deviation_should_be_correct(self): first_uptime = (1338372778.0, 4294967196L) second_uptime = (1338372900.0, 12100L) dev = Snmpv2Mib.get_uptime_deviation(first_uptime, second_uptime) self.assertTrue(abs(dev) < 0.5, msg="deviation is higher than 0.5: %r" % dev)