Skip to content

Commit

Permalink
Merge branch 'refs/heads/add-tests-for-settings-module' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowXBoss696 committed Apr 18, 2024
2 parents 42a0cb4 + 57fffba commit 92578b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class InvalidPreference(Preference):
# App Preferences ----------------------------------


def test_app_preference_getter_and_setters(preferences: AppPreferences):
def test_app_preference_getters_and_setters(preferences: AppPreferences):
"""Test if getting and setting preference is properly working or not."""

# Test default value
Expand All @@ -100,6 +100,14 @@ def test_app_preference_getter_and_setters(preferences: AppPreferences):
), f"New value mismatch. Expected: 'new_value', Found: {preferences.dummy_pref}"


def test_app_preference_missing_configuration(preferences: AppPreferences) -> None:
"""Test that error is raised if you try to access a configuration which is not defined"""

with pytest.raises(AttributeError):
# Try to access a setting which is not defined.
print(preferences.undefined_configuration)


def test_print_app_preference(preferences: AppPreferences) -> None:
"""Test app preference values are printed correctly."""

Expand Down

0 comments on commit 92578b5

Please sign in to comment.