Fix CI: ruff, black, and stale VehicleStatus tests#24
Merged
Conversation
The test workflow started running on master (bjhiltbrand#22) and surfaced three failures: - ruff UP031: cognito_timestamp used percent formatting; switched to an f-string with identical output. - black: reformatted device_srp.py, auth.py, client.py and the device tests to satisfy black --check (client.py was never black-compliant; CI just never ran black on master before). - pytest: test_from_dict_full and test_get_vehicle_status_success fed a flat dict the model never reads (VehicleStatus.from_dict parses the nested last_known_state.controller), so they asserted against unparsed values. Rewrote both to the real nested payload and the values the model actually produces. ruff check, black --check and pytest (79 passed) all pass locally.
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.
What
The test workflow began running on
masterafter #22, which exposed three failures (now all green):UP031:cognito_timestamp()used"..." % (...); switched to an f-string with identical output.device_srp.py,auth.py,client.pyand the device tests.client.pywas never black-compliant, CI just never ran black onmasterbefore now.test_from_dict_fullandtest_get_vehicle_status_successfed a flat dict (is_running,battery_percent, ...) thatVehicleStatus.from_dictnever reads, it parses the nestedlast_known_state.controller. Both were already failing. Rewrote them to the real payload shape and assert the values the model actually produces.Verification
Locally:
ruff check drone_mobile/,black --check drone_mobile/ tests/, andpytest(79 passed) all pass.