commit 09268e4ac45eb9308f67c2ee3918cd4057d7086b Author: juga0 juga@riseup.net Date: Fri Aug 31 11:24:16 2018 +0000
Implement sbws and torflow scaling in tests --- tests/unit/lib/test_v3bwfile.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tests/unit/lib/test_v3bwfile.py b/tests/unit/lib/test_v3bwfile.py index 1809e44..15b148a 100644 --- a/tests/unit/lib/test_v3bwfile.py +++ b/tests/unit/lib/test_v3bwfile.py @@ -4,7 +4,7 @@ import json import os.path
from sbws import __version__ as version -from sbws.globals import SPEC_VERSION +from sbws.globals import SPEC_VERSION, SBWS_SCALING, TORFLOW_SCALING from sbws.lib.resultdump import Result, load_result_file from sbws.lib.v3bwfile import (V3BWHeader, V3BWLine, TERMINATOR, LINE_SEP, KEYVALUE_SEP_V110, num_results_of_type, @@ -136,3 +136,15 @@ def test_from_arg_results_write_read(datadir, tmpdir, conf, args): with open(output) as fd: v3bw = fd.read() assert v3bw == str(v3bwfile) + + +def test_sbws_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 + + +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