def test_client_saves_id_and_name(self): """ Checks if Client class preserves basic state """ client = Client(self._fake_id, self._fake_name) self.assertEqual(self._fake_id, client.get_id()) self.assertEqual(self._fake_name, client.get_name())
def test_client_last_access_time(self): """ Checks if Client calculates time since access correctly """ timer = FakeTimer(self._time_increment) client = Client(self._fake_id, self._fake_name, timer) self.assertEqual(self._time_increment, client.get_time_since_access()) client.refresh() count = 5 for _ in range(0, count): timer() self.assertEqual(self._time_increment*(count+1), client.get_time_since_access())