[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Add tests for sbws and torflow scaling



commit f5cf65ed59ec4f2ed860d84da14c112604e8e773
Author: juga0 <juga@xxxxxxxxxx>
Date:   Fri Aug 31 16:18:38 2018 +0000

    Add tests for sbws and torflow scaling
---
 tests/unit/lib/test_v3bwfile.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/unit/lib/test_v3bwfile.py b/tests/unit/lib/test_v3bwfile.py
index aed989f..b0001c1 100644
--- a/tests/unit/lib/test_v3bwfile.py
+++ b/tests/unit/lib/test_v3bwfile.py
@@ -146,5 +146,11 @@ def test_sbws_scale(datadir):
 
 def test_torflow_scale(datadir):
     results = load_result_file(str(datadir.join("results.txt")))
-    v3bwfile = V3BWFile.from_results(results, scaling_method=SBWS_SCALING)
-    assert v3bwfile.bw_lines[0].bw == 8
+    v3bwfile = V3BWFile.from_results(results, scaling_method=TORFLOW_SCALING)
+    assert v3bwfile.bw_lines[0].bw == 1000
+    v3bwfile = V3BWFile.from_results(results, scaling_method=TORFLOW_SCALING,
+                                     torflow_cap=0.0001)
+    assert v3bwfile.bw_lines[0].bw == 1000
+    v3bwfile = V3BWFile.from_results(results, scaling_method=TORFLOW_SCALING,
+                                     torflow_cap=1, torflow_round_digs=0)
+    assert v3bwfile.bw_lines[0].bw == 524



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits