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
51
52
53
54
55
56
# SPDX-FileCopyrightText: 2021-2023 Constantine Evans <qslib@mb.costi.net>
# SPDX-License-Identifier: EUPL-1.2
=
assert ==
assert ==
assert ==
assert ==
assert ==
# def test_parse_argstring() -> None:
# # pylint: disable=protected-access
# # FIXME: do quotes allow spaces?
# assert qsa._parse_argstring('-arg1=val1 -arg2="val-2"') == {
# "arg1": "val1",
# "arg2": '"val-2"',
# }
# def test_validate_command_format() -> None:
# # pylint: disable=protected-access
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"\nText\n<a>")
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"\nText")
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"<a>\n\n")
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"<a>\nText\n</b><a>")
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"<a>\nText\n</a><a>")
# with pytest.raises(ValueError):
# qsp._validate_command_format(b"<a>\nText\n<a></a>")
# assert qsp._validate_command_format(b"Text") is None
# assert qsp._validate_command_format(b"Text\n") is None
# assert (
# qsp._validate_command_format(b"<a>Text<a>Text</a>\n" b"<b>Text\n\n\n</b></a>")
# is None
# )