| Total Complexity | 3 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 9 | class Route4MeGPSTests(Route4MeAPITestSuite): |
||
| 10 | """ |
||
| 11 | Route4Me Optimization Tests |
||
| 12 | """ |
||
| 13 | |||
| 14 | def test_set(self): |
||
| 15 | """ |
||
| 16 | Test Set GPS |
||
| 17 | :return: |
||
| 18 | """ |
||
| 19 | setGPS = self.route4me.setGPS |
||
| 20 | setGPS.params.update({ |
||
| 21 | 'format': FORMAT.CSV, |
||
| 22 | 'route_id': '7420A6120C1BA7B83C512E61416AECD0', |
||
| 23 | 'lat': 38.141598, |
||
| 24 | 'lng': -85.793846, |
||
| 25 | 'course': 1, |
||
| 26 | 'speed': 120, |
||
| 27 | 'device_type': DEVICE_TYPE.IPHONE, |
||
| 28 | 'member_id': 1, |
||
| 29 | 'device_guid': 'qweqweqwe', |
||
| 30 | 'device_timestamp': '2014-06-14 17:43:35', |
||
| 31 | }) |
||
| 32 | return self.assertTrue(setGPS.set_gps_track()) |
||
| 33 | |||
| 34 | def test_set_valid_device_timestamp(self): |
||
| 35 | """ |
||
| 36 | Valid Timestamp |
||
| 37 | :return: |
||
| 38 | """ |
||
| 39 | setGPS = self.route4me.setGPS |
||
| 40 | device_timestamp = '2014-36-99 57:83:85' |
||
| 41 | return self.assertRaises(ParamValueException, |
||
| 42 | setGPS.device_timestamp, device_timestamp) |
||
| 43 | |||
| 44 | def test_param_dict_validation(self): |
||
| 45 | gps = self.route4me.setGPS |
||
| 46 | self.assertRaises(ParamValueException, |
||
| 47 | gps.add, {'xxxx': 100}) |
||
| 48 | |||
| 51 | unittest.main() |