sirene.py 937 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from typing import Dict
  2. from tools.organizations.sirene import SireneTool
  3. tool = SireneTool()
  4. def test_name():
  5. assert tool.name() == "sirene"
  6. def test_description():
  7. assert (
  8. tool.description()
  9. == "The Sirene API allows you to query the Sirene directory of businesses and establishments, managed by Insee."
  10. )
  11. def test_category():
  12. assert tool.category() == "Business intelligence"
  13. def test_launch_org():
  14. results = tool.launch("blablacar", 1)
  15. assert isinstance(results, list)
  16. assert all(isinstance(item, Dict) for item in results)
  17. def test_launch_person():
  18. results = tool.launch("Karim+Terrache", 1)
  19. assert isinstance(results, list)
  20. assert all(isinstance(item, Dict) for item in results)
  21. def test_launch_person_space_format():
  22. results = tool.launch("Karim Terrache", 1)
  23. assert isinstance(results, list)
  24. assert all(isinstance(item, Dict) for item in results)