tester_1.py 589 B

12345678910111213141516171819202122232425
  1. # %%
  2. import requests
  3. import json
  4. import os
  5. from results_output_JSON import df_to_json_records, write_to_json, read_from_json, filename_results, filename_searches, path
  6. url = 'http://127.0.0.1:5000/simple_get_query'
  7. # %%
  8. searches = read_from_json(os.path.join(path, filename_searches))
  9. results = read_from_json(os.path.join(path, filename_results))
  10. # %%
  11. results_check = []
  12. for search in searches:
  13. dto = {
  14. "queryList": [search]
  15. }
  16. x = requests.post(url, json = dto)
  17. results_check.append(json.loads(x.text))
  18. # %%
  19. results_check==results
  20. # %%
  21. for res in results:
  22. print(res)
  23. # %%