From 81241bb6e2418e204b65039f2fe892520f3aa2ae Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 10 Dec 2016 11:36:58 +1300 Subject: Fix integration test script --- tools/test-integration.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools') 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): -- cgit v1.2.3