[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [sbws/master] tests: add circuitbuilder build_circuit test
commit 51053135680a381d1df258e6f7ea859f5a9bfa43
Author: juga0 <juga@xxxxxxxxxx>
Date: Wed Feb 6 17:31:41 2019 +0000
tests: add circuitbuilder build_circuit test
---
tests/integration/lib/test_circuitbuilder.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tests/integration/lib/test_circuitbuilder.py b/tests/integration/lib/test_circuitbuilder.py
new file mode 100644
index 0000000..0b47e0a
--- /dev/null
+++ b/tests/integration/lib/test_circuitbuilder.py
@@ -0,0 +1,19 @@
+"""Integration tests for circutibuilder.py"""
+
+
+def test_build_circuit(cb):
+ # Path is empty
+ path = []
+ circuit_id, _ = cb.build_circuit(path)
+ assert not circuit_id
+ # Valid path, not valid exit
+ path = ['117A456C911114076BEB4E757AC48B16CC0CCC5F',
+ '270A861ABED22EC2B625198BCCD7B2B9DBFFC93A']
+ circuit_id, _ = cb.build_circuit(path)
+ assert not circuit_id
+ # Valid path and relays
+ # path with relay1mbyteMAB and exit1
+ path = ['117A456C911114076BEB4E757AC48B16CC0CCC5F',
+ '270A861ABED22EC2B625198BCCD7B2B9DBFFC93C']
+ circuit_id, _ = cb.build_circuit(path)
+ assert circuit_id
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits