Skip to content

Commit

Permalink
WIP: Add test for invalid context selection
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Oct 30, 2023
1 parent 5a79eaf commit f6071f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests_/config/test_backend_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def test_set_selected(self):
settings.selected = "gems"
assert settings.selected == "gems"

def test_invalid_selected(self):
settings = ContextSettings(yaml.safe_load(self.context_settings))
with pytest.raises(DataSafeHavenParameterError) as exc:
settings.selected = "invalid"
assert "Context invalid is not defined." in exc

def test_context(self):
yaml_settings = yaml.safe_load(self.context_settings)
settings = ContextSettings(yaml_settings)
Expand Down

0 comments on commit f6071f5

Please sign in to comment.