Skip to content

Commit dfc7e52

Browse files
committed
Upated unit tests accordingly
1 parent de92847 commit dfc7e52

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

tests/unit/test_configuration.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Unit tests for functions defined in src/configuration.py."""
22

33
import pytest
4-
from configuration import AppConfig
4+
from configuration import AppConfig, LogicError
55
from models.config import ModelContextProtocolServer
66

77

@@ -290,63 +290,49 @@ def test_mcp_servers_property_with_servers() -> None:
290290
def test_configuration_not_loaded():
291291
"""Test that accessing configuration before loading raises an error."""
292292
cfg = AppConfig()
293-
with pytest.raises(
294-
AssertionError, match="logic error: configuration is not loaded"
295-
):
293+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
296294
cfg.configuration # pylint: disable=pointless-statement
297295

298296

299297
def test_service_configuration_not_loaded():
300298
"""Test that accessing service_configuration before loading raises an error."""
301299
cfg = AppConfig()
302-
with pytest.raises(
303-
AssertionError, match="logic error: configuration is not loaded"
304-
):
300+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
305301
cfg.service_configuration # pylint: disable=pointless-statement
306302

307303

308304
def test_llama_stack_configuration_not_loaded():
309305
"""Test that accessing llama_stack_configuration before loading raises an error."""
310306
cfg = AppConfig()
311-
with pytest.raises(
312-
AssertionError, match="logic error: configuration is not loaded"
313-
):
307+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
314308
cfg.llama_stack_configuration # pylint: disable=pointless-statement
315309

316310

317311
def test_user_data_collection_configuration_not_loaded():
318312
"""Test that accessing user_data_collection_configuration before loading raises an error."""
319313
cfg = AppConfig()
320-
with pytest.raises(
321-
AssertionError, match="logic error: configuration is not loaded"
322-
):
314+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
323315
cfg.user_data_collection_configuration # pylint: disable=pointless-statement
324316

325317

326318
def test_mcp_servers_not_loaded():
327319
"""Test that accessing mcp_servers before loading raises an error."""
328320
cfg = AppConfig()
329-
with pytest.raises(
330-
AssertionError, match="logic error: configuration is not loaded"
331-
):
321+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
332322
cfg.mcp_servers # pylint: disable=pointless-statement
333323

334324

335325
def test_authentication_configuration_not_loaded():
336326
"""Test that accessing authentication_configuration before loading raises an error."""
337327
cfg = AppConfig()
338-
with pytest.raises(
339-
AssertionError, match="logic error: configuration is not loaded"
340-
):
328+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
341329
cfg.authentication_configuration # pylint: disable=pointless-statement
342330

343331

344332
def test_customization_not_loaded():
345333
"""Test that accessing customization before loading raises an error."""
346334
cfg = AppConfig()
347-
with pytest.raises(
348-
AssertionError, match="logic error: configuration is not loaded"
349-
):
335+
with pytest.raises(LogicError, match="logic error: configuration is not loaded"):
350336
cfg.customization # pylint: disable=pointless-statement
351337

352338

0 commit comments

Comments
 (0)