Skip to content
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

Testing #46

Merged
merged 32 commits into from
Jun 11, 2020
Merged

Testing #46

merged 32 commits into from
Jun 11, 2020

Conversation

Cyber1000
Copy link
Contributor

Information about this PR:

  • there are only small changes in old code (some return values, to make it better testable)
  • this adds some classes for pytest
    • http-client/cli is tested with a small flask (http) server, simulating the device
    • both coap-clients/cli are tested with a coap server created by CoAPthon3 pip
    • I'm testing client and cli were appropriate
  • I've removed python 3.4 support, cause in coap_client.py I'm using .hex() (already merged this way in your master) and hex was added in python 3.5 . I found this problem while testing (help would work, but get and set wouldn't)
    • If you still want 3.4, I'll try to find a workaround
    • If not, I should adjust README, before merging
  • I've added 3 TODOs (search "# TODO"), I don't know really if I should let them in, TODOs in Code tend to be forgotten, but I hope that PRs in the near future make them unnecessary
  • plain_coap still uses test data from a coap device (I think they should be quite similar from the kind of output, but I don't know exactly), we may wait for Add (unit)tests #43 before merging

@rgerganov
Copy link
Owner

Thank you for your work. I will go through this next week.

Copy link
Owner

@rgerganov rgerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! If you can address the comment about Python3.4 and this should be good to go. Thanks!

.travis.yml Outdated Show resolved Hide resolved
- "3.5"
- "3.6"
- "3.7"
- "3.8"
install:
- pip install -r requirements.txt
- pip install .
script: airctrl -h && cloudctrl -h
- pip install coveralls flask pytest
- sudo iptables -t nat -I OUTPUT -p tcp -o lo --dport 80 -j REDIRECT --to-ports 5000
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a nice hack but I think it'd be better to add an optional port argument to the HTTP client which defaults to 80 and change it only when running tests; this will also allow running tests locally without messing with iptables; we can do this in a separate PR though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plain_coap and coap take port as init-argument, you are right, we should implement this too with http, but I didn't want to change too much for now.

I think we should do this in a separate PR.

Examples.md Show resolved Hide resolved
pyairctrl/airctrl.py Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
@Cyber1000
Copy link
Contributor Author

I've adjusted everything, except the iptables-hack (see the comment)
Thanks for reviewing!

@rgerganov rgerganov merged commit 3339159 into rgerganov:master Jun 11, 2020
@Cyber1000 Cyber1000 deleted the testing branch June 11, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants