blob: 7bff6c853c3ff124a5b22b0ba512d31055ff020c [file] [log] [blame]
import json
import requests
def add_test(test_name, test_data, url):
if not url.endswith("/"):
url += '/' + test_name
requests.post(url=url, data=json.dumps(test_data))
def get_test(test_name, url):
if not url.endswith("/"):
url += '/' + test_name
result = requests.get(url=url)
return json.loads(result.content)
def get_all_tests(url):
result = requests.get(url=url)
return json.loads(result.content)
if __name__ == '__main__':
url = "http://0.0.0.0:5000/api/tests"
test = get_test("GA", url=url)
print test
tests = get_all_tests(url=url)
print tests
# test["type"] = "some build name"
# add_test("bla_bla", [test], url=url)
tests = get_all_tests(url=url)
print len(tests)