concordia-docker/tools/concordiaSearch.py
Rafał Jaworski 6b59e1b0f3 cleaned tests
2019-05-30 11:25:12 +02:00

29 lines
519 B
Python
Executable File

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import unittest
import json
import requests
import sys
import time
import host
address = 'http://'+host.concordia_host
if len(host.concordia_port) > 0:
address += ':'+host.concordia_port
data = {
'operation': 'concordiaSearch',
'pattern':sys.argv[1],
'tmId':int(sys.argv[2])
}
start = time.time()
response = requests.post(address, json=data).json()
end = time.time()
print("Execution time: %.4f seconds." % (end-start))
print("Result: ")
print(response)