test_utils.py 978 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import yaml
  2. from embedchain.utils import validate_config
  3. CONFIG_YAMLS = [
  4. "configs/anthropic.yaml",
  5. "configs/azure_openai.yaml",
  6. "configs/chroma.yaml",
  7. "configs/chunker.yaml",
  8. "configs/cohere.yaml",
  9. "configs/together.yaml",
  10. "configs/ollama.yaml",
  11. "configs/full-stack.yaml",
  12. "configs/gpt4.yaml",
  13. "configs/gpt4all.yaml",
  14. "configs/huggingface.yaml",
  15. "configs/jina.yaml",
  16. "configs/llama2.yaml",
  17. "configs/opensearch.yaml",
  18. "configs/opensource.yaml",
  19. "configs/pinecone.yaml",
  20. "configs/vertexai.yaml",
  21. "configs/weaviate.yaml",
  22. ]
  23. def test_all_config_yamls():
  24. """Test that all config yamls are valid."""
  25. for config_yaml in CONFIG_YAMLS:
  26. with open(config_yaml, "r") as f:
  27. config = yaml.safe_load(f)
  28. assert config is not None
  29. try:
  30. validate_config(config)
  31. except Exception as e:
  32. print(f"Error in {config_yaml}: {e}")
  33. raise e