Пример #1
0
def route_generator(route_id):
    route = Route()
    route.name = 'Route' + str(route_id)
    route.id = route_id
    route.timestamp = 1503517240
    route.distance = 98353.19420993332
    route.elevation_gain = 1829.1980834963906
    route.athlete = Athlete()
    route.athlete.firstname = 'Rayco, A Shopping Cart 🛒'
    route.athlete.lastname = 'of All the Feelings'
    route.map = Map()
    route.map.id = 10285651
    route.map.summary_polyline = SUMMARY_POLYLINE
    return route
Пример #2
0
 def test_wrong_athlete_type(self):
     # Only allowed options are 0 and 1
     a = Athlete.deserialize({"athlete_type": 100})
     self.assertEqual(a.athlete_type, 100)
Пример #3
0
 def test_with_athlete_type_example_on_model(self):
     a = Athlete.deserialize({"athlete_type": 1})
     self.assertEqual(a.athlete_type, "runner")
Пример #4
0
 def test_wrong_athlete_type(self):
     # Only allowed options are 0 and 1
     a = Athlete.deserialize({"athlete_type": 100})
     self.assertEqual(a.athlete_type, 100)
Пример #5
0
 def test_with_athlete_type_example_on_model(self):
     a = Athlete.deserialize({"athlete_type": 1})
     self.assertEqual(a.athlete_type, "runner")