MCPcopy Create free account
hub / github.com/archlinux/archinstall / test_successful_upload

Function test_successful_upload

tests/test_share_log.py:74–83  ·  view source on GitHub ↗
(log_file: Path, resp_url: str, paste_url: str, max_byte: int | None)

Source from the content-addressed store, hash-verified

72@given(paste_url=urls, resp_url=urls, max_byte=max_bytes)
73@settings(max_examples=3, suppress_health_check=[HealthCheck.function_scoped_fixture])
74def test_successful_upload(log_file: Path, resp_url: str, paste_url: str, max_byte: int | None) -> None:
75 log_file.write_text('some log content')
76 fake_response = BytesIO(resp_url.encode())
77
78 with (
79 patch('archinstall.lib.log.logger._path', new=log_file.parent),
80 patch('urllib.request.urlopen', return_value=fake_response),
81 ):
82 result = share_install_log(paste_url, max_byte)
83 assert result == resp_url
84
85
86@given(paste_url=urls, resp_url=urls, max_byte=max_bytes)

Callers

nothing calls this directly

Calls 1

share_install_logFunction · 0.90

Tested by

no test coverage detected