diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-10 11:36:58 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-10 11:36:58 +1300 |
commit | 81241bb6e2418e204b65039f2fe892520f3aa2ae (patch) | |
tree | 5b6bc84a25be8723709a27a9e8b4c7cc61671d3b | |
parent | 33d6d288d07fdd24fa8a6307d3eff8d371f5932a (diff) | |
download | traccar-server-81241bb6e2418e204b65039f2fe892520f3aa2ae.tar.gz traccar-server-81241bb6e2418e204b65039f2fe892520f3aa2ae.tar.bz2 traccar-server-81241bb6e2418e204b65039f2fe892520f3aa2ae.zip |
Fix integration test script
-rwxr-xr-x | tools/test-integration.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/test-integration.py b/tools/test-integration.py index 4b1bca0cc..c3885095f 100755 --- a/tools/test-integration.py +++ b/tools/test-integration.py @@ -89,20 +89,20 @@ def login(): def remove_devices(cookie): request = urllib2.Request(baseUrl + '/api/devices') - request.add_header('cookie', cookie) + request.add_header('Cookie', cookie) response = urllib2.urlopen(request) data = json.load(response) if debug: print '\ndevices: %s\n' % repr(data) for device in data: request = urllib2.Request(baseUrl + '/api/devices/' + str(device['id'])) - request.add_header('cookie', cookie) + request.add_header('Cookie', cookie) request.get_method = lambda: 'DELETE' response = urllib2.urlopen(request) def add_device(cookie, unique_id): request = urllib2.Request(baseUrl + '/api/devices') - request.add_header('cookie', cookie) + request.add_header('Cookie', cookie) request.add_header('Content-Type', 'application/json') device = { 'name' : unique_id, 'uniqueId' : unique_id } response = urllib2.urlopen(request, json.dumps(device)) @@ -118,8 +118,9 @@ def send_message(port, message): def get_protocols(cookie, device_id): params = { 'deviceId' : device_id, 'from' : '2000-01-01T00:00:00.000Z', 'to' : '2050-01-01T00:00:00.000Z' } request = urllib2.Request(baseUrl + '/api/positions?' + urllib.urlencode(params)) - request.add_header('cookie', cookie) + request.add_header('Cookie', cookie) request.add_header('Content-Type', 'application/json') + request.add_header('Accept', 'application/json') response = urllib2.urlopen(request) protocols = [] for position in json.load(response): |