management-llm/task-server/unit_testing.py
2023-07-28 10:27:09 -04:00

24 lines
707 B
Python

import json
import requests
def test_get_task_tags():
with open('./tasks.json', 'r') as file:
data = json.load(file)
response = requests.post('http://127.0.0.1:5000/label_tasks', json=data)
if response.status_code == 200:
result = response.json()
print(json.dumps(result, indent=2))
else:
print(f"Error: {response.status_code}, {response.text}")
def test_assign_tasks_to_users():
with open('users_tasks.json', 'r') as file:
data = json.load(file)
response = requests.post('http://127.0.0.1:5000/assign_tasks', json=data)
print(response.json())
if __name__ == "__main__":
# test_get_task_tags()
test_assign_tasks_to_users()