Google Summer of Code: netengine

56 views
Skip to first unread message

Alessia Ventani

unread,
Mar 18, 2018, 12:15:53 PM3/18/18
to OpenWISP
Good afternoon, 

I'm writing the draft for the netengine project. What does it mean: "mock all external network calls during tests (SSH, HTTP, SNMP)"?
Will I report some examples of tests where it's useful use mock or simply the library that I will use? 

thank you,
Alessia Ventani

Federico Capoano

unread,
Mar 19, 2018, 10:11:13 AM3/19/18
to open...@googlegroups.com
in 2014 we tried to run tests by connecting to real devices, that makes it impossible to run the test suite on travis-ci and also makes it very hard for new contributors to run the tests because they have to have all the hardware needed to run the tests, which is very unpractical.

It means using the standard mock library of python to temporarily replace methods that perform external calls with simulations that behave in the same way but are just simulated.
So if you perform an HTTP request and you expect a JSON response like {"detail": "success"}, you mock the method which performs the request so it returns that value without even performing the request.

Is it clear now?

Federico

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alessia Ventani

unread,
Mar 19, 2018, 10:28:04 AM3/19/18
to open...@googlegroups.com
Yes. I will search some tests that will be use mock! Thank you for the answer!

Alessia

You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/4C8a9Yck6CM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.

Alessia Ventani

unread,
Mar 21, 2018, 6:52:16 AM3/21/18
to OpenWISP
Hi! I have published the draft for the netengine project! Can you review it and tell me if something miss?
thank you for the help! 

Alessia Ventani
Reply all
Reply to author
Forward
0 new messages