def test_get_uptime_succeeds(self): mock = flexmock() mock.should_receive('readline').once.and_return( '16544251.37 3317189.25\n') mock.should_receive('close').once self.assertEqual('16544251.37', status.get_uptime(injected_open=lambda x, y: mock))
def test_get_uptime_succeeds(self): mock = flexmock() mock.should_receive('readline').once.and_return('16544251.37 3317189.25\n') mock.should_receive('close').once self.assertEqual('16544251.37', status.get_uptime(injected_open=lambda x, y: mock))
def test_get_uptime_returns_false_on_ioerror(self): self.assertFalse(status.get_uptime(injected_open=self._raise_ioerror))