Skip to content

Commit

Permalink
Unit tests: loading additional RDHD configuration (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik authored Feb 9, 2025
1 parent ba7b32e commit fc8ea78
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/config/valid_rhdh_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ lightspeed:
servers:
- id: ollama
url: http://localhost:11434/v1
token: dummy-token
token: dummy-token
models:
- name: model-one
13 changes: 13 additions & 0 deletions tests/unit/utils/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,19 @@ def test_missing_additional_config_file():
config.reload_additional_config_file("/dev/null/non-existent", "")


def test_loading_additional_config_file_rhdh_type():
"""Check how an additional configuration file is handled."""
config.reload_additional_config_file("tests/config/valid_rhdh_config.yaml", "rhdh")


def test_loading_incorrect_additional_config_file_rhdh_type():
"""Check how an incorrect additional configuration file is handled."""
with pytest.raises(KeyError, match="No lightspeed configuration defined"):
config.reload_additional_config_file(
"tests/config/invalid_rhdh_config.yaml", "rhdh"
)


def test_additional_config_file_incorrect_type():
"""Check how an additional configuration file is handled with an incorrect type."""
with pytest.raises(
Expand Down

0 comments on commit fc8ea78

Please sign in to comment.