Migrate remaining tests to pytest-httpserver (no reliance on https://updates.xcp-ng.org) #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improvements
xcp.repository
which covers 4 additional repository code paths not covered before.pytests tests/
run off-line or with spotty internet connectionOther minor improvements
Commits
tests/httpserver_testcase.py: Add common base class for HTTP tests
Add a common base class for HTTP tests using pytest_httpserver:
tests/test_httpaccessor.py: Use common class HTTPServerTestCase
Make use of the common class HTTPServerTestCase: Many imports and methods are now provided by
tests/httpserver_testcase.py
tests/test_httprepository.py: Use local YUM and XenSource repos
Add a new self-contained testcase for testing YUM and XenSource repos with: .treeinfo, repomd.xml, packages, packages.main, .linux and .site
tests/data/repo
provides all test data, no use of updates.xcp-ng.org, runs offline (no internet connection) and is therefore very fast.tests/test_{accessor,repository}.py: Remove obsoleted HTTP tests
Remove obsolete HTTP test cases using https://updates.xcp-ng.org/ which are now replaced by new tests in tests/test_http{accessor,repository}.py