pynetcheck
pynetcheck copied to clipboard
Unit Test wishlist
Having some unit tests will help prevent mistakes like mine reported here: https://github.com/luketimothyjones/pynetcheck/pull/2#issuecomment-428803205
It would be good if we had some test data with which to test parsing regexes. We should try and get as much of a spread as possible, across different OS's and ping versions (although I suppose it's unlikely that the output will change much, it'd be good to test).
As a minimum, it would be good to have examples for:
- successful ping (0% packet loss)
- some packet loss (~50%)
- total packet loss (no response)
- non-existent domain
- no route to host.
across multiple OS types and ping versions.
Added basic ping tests and examples for Win10 and Ubuntu in #9. A good addition would be to add formatting placeholders in the ping examples, such as (example from Ubuntu):
time={ping1_time} ms
That way we can implement the more complex testing you suggest.
@JosephRedfern I added your name and GitHub handle to the contributors section at the top of netcheck.py
. Let me know if you have a problem with that; I'll remove them if so.
@luketimothyjones Great, thank you. No problems with that (nor was it expected of you).
@JosephRedfern Open source is about "us", not "me" :)