Skip to content
Snippets Groups Projects
test_coordinates_precision.py 693 B
Newer Older
Florent Aide's avatar
Florent Aide committed
import requests
import json


def test_coordinates_precision():
    
    headers = {'X-Messaging-Token':'mykey-41a83fb8-d6c1-4aed-adaa-2dc0906a386d'}
    latlon = [
#                 {'lat': 43.70895, 'lng':7.280680},
#                 {'lat': 43.70896, 'lng':7.280680}
                {'lat': 43.70895, 'lng':7.280680},
                {'lat': 43.70896, 'lng':7.280680}
            ]
    response = requests.post('http://localhost:6543/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_coordinates_precision()