[tor-bugs] #6950 [pyonionoo]: write tests for pyonionoo
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Thu Oct 11 16:11:05 UTC 2012
#6950: write tests for pyonionoo
-----------------------+----------------------------------------------------
Reporter: gsathya | Owner: gsathya
Type: task | Status: accepted
Priority: normal | Milestone:
Component: pyonionoo | Version:
Keywords: | Parent:
Points: | Actualpoints:
-----------------------+----------------------------------------------------
Comment(by karsten):
Replying to [comment:5 gsathya]:
> WIP - https://github.com/gsathya/pyonionoo/compare/tests
>
> THings to do -
> * add more tests
> * fix the "fixme"s
> * figure a better design than to store responses in a separate file
I had a quick look at the branch, and my first feedback is similar to your
third TODO item: comparing returned JSON document strings for equality is
probably a poor plan. This is going to fail with Java Onionoo for
whitespace reasons and different orderings of dictionary elements (neither
of which affect the JSON content). Also, these strings are going to be
hard to maintain for future tests. We should rather check the result
content for given properties, e.g., number of contained bridges/relays,
whether the result contains a given relay or bridge fingerprint, whether
there are relays with the running bit even though we didn't ask for them,
etc. These checks can be more detailed in the first test or two, and
further tests can only check the things we expect to have changed. Maybe
there should be helper methods for testing a given property of a returned
document, so that the actual test cases can stay small.
I'm happy to help with adding more tests, but I'd rather wait until
there's a framework to check response properties, or we'll have to rewrite
tests once that framework is there.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6950#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list