-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathtest_Result.py
More file actions
28 lines (25 loc) · 892 Bytes
/
test_Result.py
File metadata and controls
28 lines (25 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import importlib
script = importlib.import_module("aci-preupgrade-validation-script")
def test_print_result_handles_mixed_type_rows_without_error():
# Verify that Result stringifies all cell values, so data.sort() in print_result never fails.
r = script.Result(
result=script.FAIL_O,
headers=["col1"],
data=[[1], ["2"]],
unformatted_headers=["col1"],
unformatted_data=[[3], ["4"]],
)
# All values must already be strings after construction.
assert r.data == [["1"], ["2"]]
assert r.unformatted_data == [["3"], ["4"]]
# print_result must not raise.
script.print_result(
index=1,
total=1,
title="Mixed type table",
result=script.FAIL_O,
headers=r.headers,
data=r.data,
unformatted_headers=r.unformatted_headers,
unformatted_data=r.unformatted_data,
)