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

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



commit 75a6650dbc483385b5fea194df3c7d154f702284
Author: juga0 <juga@xxxxxxxxxx>
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)



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