Skip to content

Commit

Permalink
TST #5 available data changed, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 12, 2022
1 parent 9b58445 commit a0908a5
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions apsbss/tests/test_apsbss_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,31 @@ def test_cycle_not_found():
assert f"APS cycle '{cycle}' not found." in str(exc.value)


def test_listESAFs():
@pytest.mark.parametrize(
"cycle, 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],
]
)
def test_listESAFs(cycle, sector, count):
if is_aps_workstation():
cycle = "2020-2"
assert len(apsbss.listESAFs(cycle, 9)) == 35
assert len(apsbss.listESAFs([cycle], 9)) == 35
assert len(apsbss.listESAFs((cycle), 9)) == 35
assert len(apsbss.listESAFs("2020-1", 9)) == 41
assert len(apsbss.listESAFs(["2020-1", "2020-2"], 9)) == 41 + 35
# TODO: other tests


def test_listProposals():
assert len(apsbss.listESAFs(cycle, sector)) == count


@pytest.mark.parametrize(
"cycle, bl, count",
[
["2011-3", "9-ID-B,C", 0],
["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],
]
)
def test_listProposals(cycle, bl, count):
if is_aps_workstation():
cycle = "2020-2"
bl = "9-ID-B,C"
assert len(apsbss.listProposals(cycle, bl)) == 21
assert len(apsbss.listProposals([cycle], bl)) == 21
assert len(apsbss.listProposals((cycle), bl)) == 21
assert len(apsbss.listProposals("2020-1", bl)) == 12
assert (
len(apsbss.listProposals(["2020-1", "2020-2"], bl)) == 12 + 21
)
# TODO: other tests
assert len(apsbss.listProposals(cycle, bl)) == count

0 comments on commit a0908a5

Please sign in to comment.