Exemple #1
0
 def test_get_response(self):
     traffic = Traffic("foo", "bar")
     traffic.duration = "10 thousand years"
     expected = {
         "travel_time": "10 thousand years",
         "start_location": "foo",
         "destination": "bar",
     }
     actual = traffic.get_response()
Exemple #2
0
    def test_make_dynamo_data(self):
        traffic = Traffic("foo", "bar")
        traffic.duration = {"hours": "1", "minutes": "30"}
        time.time = MagicMock(return_value=123456789)

        actual = traffic.make_dynamo_data()
        expected = {
            "identifier": "bar---foo",
            "hours": "1",
            "minutes": "30",
            "time": 123456789
        }
        self.assertEqual(actual, expected)