test_utils.py 949 B

12345678910111213141516171819202122232425262728293031323334353637
  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/ollama.yaml",
  10. "configs/full-stack.yaml",
  11. "configs/gpt4.yaml",
  12. "configs/gpt4all.yaml",
  13. "configs/huggingface.yaml",
  14. "configs/jina.yaml",
  15. "configs/llama2.yaml",
  16. "configs/opensearch.yaml",
  17. "configs/opensource.yaml",
  18. "configs/pinecone.yaml",
  19. "configs/vertexai.yaml",
  20. "configs/weaviate.yaml",
  21. ]
  22. def test_all_config_yamls():
  23. """Test that all config yamls are valid."""
  24. for config_yaml in CONFIG_YAMLS:
  25. with open(config_yaml, "r") as f:
  26. config = yaml.safe_load(f)
  27. assert config is not None
  28. try:
  29. validate_config(config)
  30. except Exception as e:
  31. print(f"Error in {config_yaml}: {e}")
  32. raise e