Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: mock network functions so tests work with no network #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdamWill
Copy link
Contributor

Noticed this while trying to enable the tests in a package build.

@AdamWill
Copy link
Contributor Author

CI needs the fixes from #310 to work right.

There's a few places where the tests implicitly need a network
connection. Mainly, since the TDL XML test blocks in test_guest
are for a subclass of RedHatLinuxCDYumGuest and specify a URL,
we wind up hitting RedHatLinuxCDYumGuest._check_url which tries
to get the headers for the URL to figure out if the server
supports byte ranges. Let's just mock out the header retrieval
to make that method happy. Secondly, test-53-command-http-url.tdl
specifies an HTTP URL, so we wind up trying to retrieve it;
mock out the actual download, since that's not what this test is
really exercising.

Signed-off-by: Adam Williamson <[email protected]>
@AdamWill AdamWill changed the title test_guest: mock http_get_header so tests work with no network tests: mock network functions so tests work with no network Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant