Skip to content
Snippets Groups Projects

[AGIPD][TESTs]test_agipdlib AGIPDCtrl and get_bias_voltage for AGIPD1M and AGIPD500K

Merged Karim Ahmed requested to merge test/test_agipdlib into master
All threads resolved!
1 file
+ 33
1
Compare changes
  • Side-by-side
  • Inline
+ 33
1
import logging
import sys
from pathlib import Path
from unittest import mock
@@ -88,7 +89,6 @@ def test_parse_config():
for dcache in [None, None, "DESY_DCACHE_RAW_CC"]
}
)
async def test_wait_on_transfer(
tmp_path: Path,
run_links_to: str,
@@ -143,6 +143,38 @@ async def test_wait_on_transfer(
if not expected_error:
raise e
@pytest.mark.parametrize(
"repositories",
{
(gpfs_online, gpfs_offline, dcache)
for gpfs_online in [None, None, "XFEL_GPFS_ONLINE_RAW_CC"]
for gpfs_offline in [None, None, "XFEL_GPFS_OFFLINE_RAW_CC"]
for dcache in [None, None, "DESY_DCACHE_RAW_CC"]
}
)
@pytest.mark.asyncio
async def test_wait_on_transfer_invalid_run_dir(caplog, repositories):
response = mock.Mock()
response.status_code = 200
response.json = lambda: {"runs": [{"repositories": {r: None for r in repositories}}]}
client = mock.Mock()
client.get_runs_by_proposal_number_api = mock.Mock(return_value=response)
caplog.set_level(logging.WARNING)
res = await wait_on_transfer(
client,
run=0,
proposal=str(10),
run_dir=Path("/invalid/run/dir"),
max_tries=1,
sleep_completion=0,
)
assert res is None
assert "is not relative to" in caplog.text
@pytest.mark.asyncio
@pytest.mark.parametrize(
"mock_json, status_code, exception_class, exception_match",
Loading