Skip to content

Commit

Permalink
tweak expected url patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Jan 11, 2025
1 parent e4a262b commit 0f0046f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,67 +269,67 @@ def test_list_src_doc_examples_modules(
(
"list-src windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(".*/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"),
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("src", "archives"),
),
(
"list-doc windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(".*/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"),
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("doc", "archives"),
),
(
"list-example windows 5.15.2",
"windows-5152-src-doc-example-update.xml",
re.compile(".*/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"),
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("examples", "archives"),
),
(
"list-doc windows 5.15.2 --modules",
"windows-5152-src-doc-example-update.xml",
re.compile(".*/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"),
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("doc", "modules"),
),
(
"list-example windows 5.15.2 --modules",
"windows-5152-src-doc-example-update.xml",
re.compile(".*/windows_x86/desktop/qt5_5152_src_doc_examples/Updates.xml"),
re.compile(r"/windows_x86/desktop/qt5_5152_src_doc_examples/Updates\.xml$"),
win_5152_sde_expected("examples", "modules"),
),
(
"list-src windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("src", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-doc windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("doc", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-example windows 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("examples", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-src all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("src", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-doc all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("doc", "archives", "all_os-681-src-doc-example-expect.json"),
),
(
"list-example all_os 6.8.1",
"all_os-681-src-doc-example-update.xml",
re.compile(".*/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates.xml"),
re.compile(r"/all_os/qt/qt6_681_(?:unix|windows)_line_endings_src/Updates\.xml$"),
win_sde_expected("examples", "archives", "all_os-681-src-doc-example-expect.json"),
),
),
Expand All @@ -338,7 +338,7 @@ def test_list_src_doc_examples_cli(
monkeypatch, capsys, command: str, updates_file: str, url: re.Pattern, expected: Set[str]
):
def mock_fetch(self, rest_of_url):
assert url.match(rest_of_url)
assert url.search(rest_of_url), f"Unexpected URL: {rest_of_url}"
return (Path(__file__).parent / "data" / updates_file).read_text("utf-8")

monkeypatch.setattr(MetadataFactory, "fetch_http", mock_fetch)
Expand Down

0 comments on commit 0f0046f

Please sign in to comment.