-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor tests and add tests for the beamline name mapping
- Loading branch information
1 parent
669d5ab
commit 24d7d98
Showing
3 changed files
with
63 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
|
||
from dodal.beamlines import ( | ||
all_beamline_names, | ||
module_name_for_beamline, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"beamline,expected_module", | ||
{ | ||
"i03": "i03", | ||
"s03": "i03", | ||
"i04-1": "i04_1", | ||
"i22": "i22", | ||
}.items(), | ||
) | ||
def test_beamline_name_mapping(beamline: str, expected_module: str): | ||
assert module_name_for_beamline(beamline) == expected_module | ||
|
||
|
||
def test_all_beamline_names_includes_non_overridden_modules(): | ||
beamlines = set(all_beamline_names()) | ||
assert "i22" in beamlines | ||
|
||
|
||
def test_all_beamline_names_includes_overriden_modules(): | ||
beamlines = set(all_beamline_names()) | ||
assert "i04-1" in beamlines | ||
|
||
|
||
def test_all_beamline_names_includes_overriden_default_modules(): | ||
beamlines = set(all_beamline_names()) | ||
assert "i03" in beamlines | ||
assert "s03" in beamlines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters