[tor-commits] [sbws/master] tests: scale lines using torflow's method

juga at torproject.org juga at torproject.org
Wed Nov 21 14:24:05 UTC 2018


commit 75a6650dbc483385b5fea194df3c7d154f702284
Author: juga0 <juga at riseup.net>
Date:   Tue Nov 20 11:23:05 2018 +0000

    tests: scale lines using torflow's method
---
 tests/unit/lib/test_v3bwfile.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/unit/lib/test_v3bwfile.py b/tests/unit/lib/test_v3bwfile.py
index 3367c77..2987aca 100644
--- a/tests/unit/lib/test_v3bwfile.py
+++ b/tests/unit/lib/test_v3bwfile.py
@@ -227,9 +227,10 @@ def test_from_results_read(datadir, tmpdir, conf, args):
     expected_header = V3BWHeader(timestamp_l,
                                  earliest_bandwidth=earliest_bandwidth,
                                  latest_bandwidth=latest_bandwidth)
-    expected_bwls = [V3BWLine.from_results(results[fp]) for fp in results]
-    # bw store now B, not KB
-    expected_bwls[0].bw = round(expected_bwls[0].bw / 1000)
+    raw_bwls = [V3BWLine.from_results(results[fp]) for fp in results]
+    # Scale BWLines using torflow method, since it's the default and BWLines
+    # bandwidth is the raw bandwidth.
+    expected_bwls = V3BWFile.bw_torflow_scale(raw_bwls)
     expected_f = V3BWFile(expected_header, expected_bwls)
     # This way is going to convert bw to KB
     v3bwfile = V3BWFile.from_results(results)





More information about the tor-commits mailing list