def test_load_last_request(self): mock_request_1 = self._create_mock_request() mock_request_2 = self._create_mock_request() storage = RequestStorage(base_dir=self.base_dir) storage.save_request(mock_request_1) request_id2 = storage.save_request(mock_request_2) last_request = storage.load_last_request() self.assertEqual(last_request['id'], request_id2)
def test_load_last_request(self): request_1 = self._create_request() request_2 = self._create_request() storage = RequestStorage(base_dir=self.base_dir) storage.save_request(request_1) storage.save_request(request_2) last_request = storage.load_last_request() self.assertEqual(request_2.id, last_request.id)
def test_load_last_request_none(self): storage = RequestStorage(base_dir=self.base_dir) last_request = storage.load_last_request() self.assertIsNone(last_request)