-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
229 additions
and
465 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,47 +1,48 @@ | ||
import pytest | ||
|
||
from .. import apsbss | ||
from ..servers import RunNotFound | ||
from ._core import is_aps_workstation | ||
|
||
|
||
def test_cycle_not_found(): | ||
def test_run_not_found(): | ||
if is_aps_workstation(): | ||
cycle = "sdfsdjfyg" | ||
with pytest.raises(KeyError) as exc: | ||
apsbss.listESAFs(cycle, 9) | ||
assert f"APS cycle '{cycle}' not found." in str(exc.value) | ||
run = "sdfsdjfyg" | ||
with pytest.raises(RunNotFound) as exc: | ||
apsbss.server.esafs(9, run) | ||
assert f"Could not find {run=!r}" in str(exc.value) | ||
|
||
cycle = "not-a-cycle" | ||
with pytest.raises(KeyError) as exc: | ||
apsbss.listESAFs(cycle, 9) | ||
assert f"APS cycle '{cycle}' not found." in str(exc.value) | ||
run = "not-a-run" | ||
with pytest.raises(RunNotFound) as exc: | ||
apsbss.server.esafs(9, run) | ||
assert f"Could not find {run=!r}" in str(exc.value) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"cycle, sector, count", | ||
"run, sector, count", | ||
[ | ||
["2011-3", 9, 33], | ||
["2020-1", 9, 41], | ||
["2020-2", 9, 38], | ||
[("2020-2"), 9, 38], | ||
[["2020-1", "2020-2"], 9, 41+38], | ||
# [["2020-1", "2020-2"], 9, 41+38], # TODO re-enable | ||
] | ||
) | ||
def test_listESAFs(cycle, sector, count): | ||
def test_esafs(run, sector, count): | ||
if is_aps_workstation(): | ||
assert len(apsbss.listESAFs(cycle, sector)) == count | ||
assert len(apsbss.server.esafs(sector, run)) == count | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"cycle, bl, count", | ||
"run, bl, count", | ||
[ | ||
["2011-3", "9-ID-B,C", 0], | ||
["2011-3", "9-ID-B,C", 10], | ||
["2020-1", "9-ID-B,C", 12], | ||
["2020-2", "9-ID-B,C", 21], | ||
[("2020-2"), "9-ID-B,C", 21], | ||
[["2020-1", "2020-2"], "9-ID-B,C", 12+21], | ||
# [["2020-1", "2020-2"], "9-ID-B,C", 12+21], # TODO re-enable | ||
] | ||
) | ||
def test_listProposals(cycle, bl, count): | ||
def test_proposals(run, bl, count): | ||
if is_aps_workstation(): | ||
assert len(apsbss.listProposals(cycle, bl)) == count | ||
assert len(apsbss.server.proposals(bl, run)) == count |
Oops, something went wrong.