test_utils.py 981 B

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