support/testing: add python-treq tests
Use a simple script to check the basic usage. The target has no https server, so a connection from in the target to localhost must not succeed. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
ac010beec5
commit
2979ab9bd5
16
support/testing/tests/package/sample_python_treq.py
Normal file
16
support/testing/tests/package/sample_python_treq.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from twisted.internet import reactor
|
||||
import treq
|
||||
|
||||
|
||||
def done(response):
|
||||
print(response.code)
|
||||
reactor.stop()
|
||||
|
||||
|
||||
def err(fail):
|
||||
print(fail.value)
|
||||
reactor.stop()
|
||||
|
||||
|
||||
treq.get("https://localhost").addCallback(done).addErrback(err)
|
||||
reactor.run()
|
||||
Reference in New Issue
Block a user