diff options
author | Taseer <taseer94@gmail.com> | 2017-03-29 09:34:31 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-03 08:23:29 +0000 |
commit | 08641031dd2ead76e4d29b0a66be5c028076990d (patch) | |
tree | 1bcd3a77e0a14e7ff57cead3b455d0a2f79000ce /tests/unit | |
parent | 9a2f9e8a32e02d7541a76e518e2907f7da939bfd (diff) |
Beautify compute report
Change-Id: I0c4faa3720d980970f923697c879627ccbf22852
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/cli/cmd_report_test.py | 64 | ||||
-rw-r--r-- | tests/unit/reporter/console_test.py | 55 |
2 files changed, 48 insertions, 71 deletions
diff --git a/tests/unit/cli/cmd_report_test.py b/tests/unit/cli/cmd_report_test.py index 9263707f..21e757d8 100644 --- a/tests/unit/cli/cmd_report_test.py +++ b/tests/unit/cli/cmd_report_test.py @@ -30,70 +30,56 @@ def test_dhrystone(runner, result_path): """Test dhrystone report""" result = runner.invoke(cli, ['report', 'show', 'dhrystone', '-p', result_path]) - assert "Benchmark: dhrystone" in result.output - assert "CPU Usage: 3%" in result.output - assert "Number: 40" in result.output - assert "Score: 63529.6" in result.output - assert "Single CPU:" in result.output - assert "Total CPUs: 40" in result.output + assert "Benchmark..............................................................." \ + "...................dhrystone" in result.output + assert "Score..................................................................." \ + "..................63529.6" def test_whetstone(runner, result_path): """ Test whetstone output""" result = runner.invoke(cli, ['report', 'show', 'whetstone', '-p', result_path]) - assert "Benchmark: whetstone" in result.output - assert "CPU Usage: 3%" in result.output - assert "Results:" in result.output - assert "Multi CPU:" in result.output - assert "Number: 40" in result.output - assert "Score: 21198.3" in result.output - assert "Single CPU:" in result.output + assert "Number................................................................." \ + "...........................40" in result.output + assert "Total CPUs............................................................." \ + "...........................40" def test_dpi(runner, result_path): """ Test dpi report""" result = runner.invoke(cli, ['report', 'show', 'dpi', '-p', result_path]) - assert "Benchmark: dpi" in result.output - assert "CPU Usage: 3%" in result.output - assert "Bits per Second: 3.638" in result.output - assert "Packets per Second: 1.45" in result.output - assert "Bits per Second: 3.69" in result.output - assert "Packets per Second: 1.458" in result.output + assert "Bits per Second..................................................." \ + ".............................3.638" in result.output + assert "Packets per Second................................................" \ + ".............................1.458" in result.output def test_ramspeed(runner, result_path): """ Test ramspeed report """ result = runner.invoke(cli, ['report', 'show', 'ramspeed', '-p', result_path]) - assert "Benchmark: ramspeed" in result.output - assert "CPU Usage: 3%" in result.output - assert "Float Addition: 10217.62" in result.output - assert "Float Average: 9176.88" in result.output - assert "Float Copy: 8127.13" in result.output - assert "Float Scale: 8085.40" in result.output - assert "Float Triad: 10277.38" in result.output - assert "Integer Addition: 11471.63" in result.output - assert "Integer Average: 11396.35" in result.output + assert "Float Addition........................................................" \ + "......................10522.33" in result.output + assert "Integer Average........................................................" \ + ".....................11466.52" in result.output def test_ssl(runner, result_path): """ Test ssl report""" result = runner.invoke(cli, ['report', 'show', 'ssl', '-p', result_path]) - assert "Benchmark: ssl" in result.output - assert "CPU Usage: 3%" in result.output - assert "AES 128 CBC (bytes):" in result.output - assert "256: 584951.30k" in result.output - assert "RSA SIGN:" in result.output - assert "2048: 9.9" in result.output - assert "RSA VERIFY:" in result.output - assert "4096: 7688.5" in result.output + assert "8192............................................................." \ + ".........................667303.94k" in result.output + assert "1024.............................................................." \ + "..........................100088.3" in result.output def test_sys(runner, result_path): """ Test sys_info """ result = runner.invoke(cli, ['report', 'show', 'ssl', '-p', result_path]) - assert "System Information:" in result.output - assert "Host Name: node-38.zte.com.cn" in result.output - assert "Memory: 4403.7/128524.1MB" in result.output + assert "System Information" in result.output + assert "Host Name........................................................" \ + ".................node-38.zte.com.cn" in result.output + assert "Operating System.................................................." \ + "...............Ubuntu 16.04 xenial" in result.output diff --git a/tests/unit/reporter/console_test.py b/tests/unit/reporter/console_test.py index 037ef2fb..7ece4663 100644 --- a/tests/unit/reporter/console_test.py +++ b/tests/unit/reporter/console_test.py @@ -33,65 +33,56 @@ def test_dhrystone(console_reporter, result_path): """ Test dhrystone report""" result = console_reporter.render('dhrystone', result_path) - assert "Benchmark: dhrystone" in result - assert "Number: 40" in result - assert "Score: 63529.6" in result - assert "Single CPU:" in result - assert "Total CPUs: 40" in result + assert "Benchmark..............................................................." \ + "...................dhrystone" in result def test_whetstone(console_reporter, result_path): """ Test whetstone output""" result = console_reporter.render('whetstone', result_path) - assert "Benchmark: whetstone" in result - assert "Results:" in result - assert "Multi CPU:" in result - assert "Number: 40" in result - assert "Score: 21198.3" in result - assert "Single CPU:" in result + assert "Number................................................................." \ + "...........................40" in result + assert "Total CPUs............................................................." \ + "...........................40" in result def test_dpi(console_reporter, result_path): """ Test dpi report""" result = console_reporter.render('dpi', result_path) - assert "Benchmark: dpi" in result - assert "Bits per Second: 3.638" in result - assert "Packets per Second: 1.45" in result - assert "Bits per Second: 3.69" in result - assert "Packets per Second: 1.458" in result + assert "Bits per Second..................................................." \ + ".............................3.638" in result + assert "Packets per Second................................................" \ + ".............................1.458" in result def test_ramspeed(console_reporter, result_path): """ Test ramspeed report """ result = console_reporter.render('ramspeed', result_path) - assert "Float Addition: 10217.62" in result - assert "Float Average: 9176.88" in result - assert "Float Copy: 8127.13" in result - assert "Float Scale: 8085.40" in result - assert "Float Triad: 10277.38" in result - assert "Integer Addition: 11471.63" in result - assert "Integer Average: 11396.35" in result + assert "Float Addition........................................................" \ + "......................10522.33" in result + assert "Integer Average........................................................" \ + ".....................11466.52" in result def test_ssl(console_reporter, result_path): """ Test ssl report""" result = console_reporter.render('ssl', result_path) - assert "AES 128 CBC (bytes):" in result - assert "256: 584951.30k" in result - assert "RSA SIGN:" in result - assert "2048: 9.9" in result - assert "RSA VERIFY:" in result - assert "4096: 7688.5" in result + assert "8192............................................................." \ + ".........................667303.94k" in result + assert "1024.............................................................." \ + "..........................100088.3" in result def test_sys(console_reporter, result_path): """ Test sys_info """ result = console_reporter.render('ssl', result_path) - assert "System Information:" in result - assert "Host Name: node-38.zte.com.cn" in result - assert "Memory: 4403.7/128524.1MB" in result + assert "System Information" in result + assert "Host Name........................................................" \ + ".................node-38.zte.com.cn" in result + assert "Operating System.................................................." \ + "...............Ubuntu 16.04 xenial" in result |