[tor-commits] [sbws/master] tests: add circuitbuilder build_circuit test

juga at torproject.org juga at torproject.org
Fri Feb 15 17:42:48 UTC 2019


commit 51053135680a381d1df258e6f7ea859f5a9bfa43
Author: juga0 <juga at riseup.net>
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





More information about the tor-commits mailing list