GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( bb2a36...022c91 )
by Juan Jose
01:36
created

Route4MeGPSTests.test_set()   B

Complexity

Conditions 1

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
dl 0
loc 24
rs 8.9713
1
import unittest
2
import datetime
3
from route4me.exceptions import ParamValueException
4
from route4me.constants import FORMAT, DEVICE_TYPE
5
6
from tests.base import Route4MeAPITestSuite
7
8
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
        route = self.route4me.route
20
        response = route.get_routes(limit=10, offset=5)
21
        self.assertFalse(hasattr(response, 'errors'))
22
        self.assertTrue(len(response) > 0)
23
        route_id = response[0].get('route_id', False)
24
        setGPS = self.route4me.setGPS
25
        params = {
26
            'format': 'serialized',
27
            'route_id': route_id,
28
            'lat': 38.141598,
29
            'lng': -85.793846,
30
            'course': 1,
31
            'speed': 120,
32
            'device_type': DEVICE_TYPE.IPHONE,
33
            'member_id': 1,
34
            'device_guid': 'qweqweqwe',
35
            'device_timestamp': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
36
        }
37
        return self.assertTrue(setGPS.set_gps_track(**params))
38
39
    def test_set_valid_device_timestamp(self):
40
        """
41
        Valid Timestamp
42
        :return:
43
        """
44
        setGPS = self.route4me.setGPS
45
        device_timestamp = '2014-36-99 57:83:85'
46
        return self.assertRaises(ParamValueException,
47
                                 setGPS.device_timestamp, device_timestamp)
48
49
    def test_param_dict_validation(self):
50
        gps = self.route4me.setGPS
51
        self.assertRaises(ParamValueException,
52
                                 gps.add, {'xxxx': 100})
53
54
55
if __name__ == '__main__':
56
    unittest.main()
57