-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Adds CONTRIBUTING info for tests. #212
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
Conversation
For example, the addition of a new API item for retrieving a vehicle attribute would need test code for | ||
getting, setting (if applicable) and printing the attribute. An easy way to create this would be to | ||
update and run :ref:`example-vehicle-state`. | ||
Web client tests use nose. First export a DRONEAPI_KEY in the format `<id>.<key>`. The run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is nose? Should be a link. Similarly, the DRONEAPI_KEY should link to our cloud docs.
What are the web client tests? Worth a line explaining what these tests cover.
Need to add information about the different classes of tests and how to write for each of them as per #223 |
f1ad946
to
26adfaa
Compare
@hamishwillee I updated this doc with all suites of tests and addressed your comments. Feel free to review again. These docs will accompany the 1.4.0 release (which is mostly just the addition of the test infrastructure). |
Hi @tcr3dr Look pretty good. I pushed some minor subedits for style structure. Please check you're happy with those. Comments:
|
@hamishwillee I address most of your concerns.
If this passes CI and you are happy with it, let me know! |
Fix another minor typo
@tcr3dr Really good fix/response! I created #233 (like #232) and added a couple of minor typo fixes to highlighting of assert_equals. My only concern is that we refer to mock but there is no useful real-world example (e.g. test_api.py) that shows enough to know "correct use". Consider the example:
From a user perspective trying to work out how to use Mock with dronekit I wonder what APIModule is (since it isn't public). Why not use the local_connection? Reading the mock docs I might assume that here you are providing a "Mock" connection to use, and that guarantees that The use of Mock implies that these tests never run against a real device - correct? Upshot, a little more explanation of mock or a better example which we link to as an example would help. I would be happy for what we have here now to go out and this additional material to be provided in a separate issue if you preferred. |
@hamishwillee Good points. I'll split that into a separate issue. Mostly because I'm not super familiar with Mock myself yet, though I've seen it used extensively by @eliao to good effect. As the tests improve, so shall the docs. |
Adds CONTRIBUTING info for tests.
I'm relatively new to Mock myself, but it seems quite handy. It's very useful for isolating tests so that they test only exactly what they are meant to. If the tests include networking, etc, then they can fail/succeed due to things that are outside their control. Unit testing vs. functional testing. |
Needs work.