1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# SPDX-FileCopyrightText: 2021-2023 Constantine Evans <qslib@mb.costi.net>
# SPDX-License-Identifier: EUPL-1.2
# def test_drawer(monkeypatch):
# def patchrun(self, value: str) -> str:
# if value == "CLOSE":
# return ""
# else:
# raise ValueError
# monkeypatch.setattr(Machine, "run_command", patchrun)
# m = Machine("none")
# m.drawer_close()
# @pytest.mark.parametrize(
# "function",
# [
# ("drawer_position", ()),
# ("machine_status", ()),
# ("run_status", ()),
# ("get_running_protocol", ()),
# ("list_runs_in_storage", ()),
# ],
# )
# def test_mach_not_connected(function: tuple[str, tuple[Any]]) -> None:
# m = Machine("none")
# with pytest.raises(ConnectionError):
# getattr(m, function[0]).__call__(*function[1])
# @pytest.mark.parametrize(
# "function",
# [
# ("from_running", (Machine("none"),)),
# (
# "from_machine_storage",
# (
# Machine("none"),
# "filename",
# ),
# ),
# ],
# )
# def test_expload_not_connected(function: str) -> None:
# with pytest.raises(ConnectionError):
# getattr(Experiment, function[0]).__call__(*function[1])