Skip to content
Snippets Groups Projects
test_service.py 741 B
Newer Older
import requests
import json


def test_service():
Patrice Journoud's avatar
Patrice Journoud committed

    headers = \
        {'X-Messaging-Token':
         'test_create_user:username-6fda9a12-9dcd-4930-9dec-5fb4090bf83a'}

Patrice Journoud's avatar
Patrice Journoud committed
                {'lat': 43.83032, 'lng': 4.359950},
                {'lat': 50.66554, 'lng': 3.104470},
                {'lat': 50.31392, 'lng': 2.744560},
                {'lat': 50.65272, 'lng': 3.025470}
Patrice Journoud's avatar
Patrice Journoud committed
    response = requests.post('http://localhost:6544/tsp',
                             json.dumps(latlon),
                             headers=headers)

    txt = json.loads(response.text)
    if response.status_code == 401:
        print('Unauthorized')
    else:
        print(txt)
if __name__ == '__main__':
    test_service()