Repository navigation
Organize the tests by component and share one base URL - #55
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test-only cleanup.
test_client.pyhad grown to 44 tests covering every part of the client, and the device URL was written out by hand in most test files. The tests are now grouped by the component they exercise and use one shared URL constant.Changes
test_client.pyis split by component. Its tests moved, unchanged, to new files named after the modules innanokvm/components:test_storage.py,test_network.py,test_system.py,test_stream.py,test_hid.py,test_services.pyandtest_video.py. Five tests went to files that already covered their subject: version parsing and version gates totest_endpoint_compatibility.py, and payload leaks in errors and logs totest_response_redaction.py.test_client.pykeeps the 9 tests about the client itself: the context manager, the response envelope,detect_versions, and one model test that spans two components.BASE_URL. Tests that spelled outhttp://localhost:8888/api/orhttp://kvm.local/api/, or defined their own_BASE_URLor_URL, now importBASE_URLfromtests/common.py.test_ssl.pyhas a local_BASE_URLbecause it is the only file that needs HTTPS.AsyncGeneratoron async context managers. Two test helpers decorated with@asynccontextmanagerwere annotated as returningAsyncIterator, which type checkers flag as deprecated.Notes
kvm.localnow run againstlocalhost:8888. None of them depended on the host.ws://URL intest_account_permissions.py, used once, and theold-kvm.localandnew-kvm.localURLs intest_component_session.py, which test a URL change.Behaviour changes
None. No file under
nanokvm/changes.Testing
The same 404 unit tests pass after each of the three commits.