示例#1
0
 def test_repr(self):
     info = NodeInfo('spa', '1.1.1.1', True, False)
     info.latency = 5
     info.latency = 14
     expected = ('name: SP A, ip: 1.1.1.1, available: True, '
                 'working: False, latency: 10.0, timestamp: None')
     assert_that(repr(info), equal_to(expected))
示例#2
0
 def test_repr(self):
     info = NodeInfo('spa', '1.1.1.1', True, False)
     info.latency = 5
     info.latency = 14
     expected = ('name: SP A, ip: 1.1.1.1, available: True, '
                 'working: False, latency: 10.0, timestamp: None')
     assert_that(repr(info), equal_to(expected))
 def test_is_updated_within(self):
     info = NodeInfo('spa', '1.1.1.1')
     info.available = True
     assert_that(info.is_updated_within(0), equal_to(False))
     assert_that(info.is_updated_within(1), equal_to(True))
 def test_remove_extra_quotes(self):
     info = NodeInfo('spa', '  \'"1.1.1.1" \'   ')
     assert_that(info.ip, equal_to('1.1.1.1'))