Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
masaccio committed Jul 24, 2023
1 parent 98f8c07 commit bf2e5a6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 37 deletions.
8 changes: 2 additions & 6 deletions tests/test_cat_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ def test_select_table(script_runner):
def test_list_sheets(script_runner):
ret = script_runner.run(["cat-numbers", "-S", DOCUMENT], print_result=False)
assert ret.success
assert ret.stdout == (
f"{DOCUMENT}: ZZZ_Sheet_1\n" "tests/data/test-1.numbers: ZZZ_Sheet_2\n"
)
assert ret.stdout == (f"{DOCUMENT}: ZZZ_Sheet_1\n" "tests/data/test-1.numbers: ZZZ_Sheet_2\n")
assert ret.stderr == ""


Expand Down Expand Up @@ -257,9 +255,7 @@ def test_main(script_runner):

@pytest.mark.script_launch_mode("subprocess")
def test_corrupted(script_runner):
ret = script_runner.run(
["cat-numbers", "tests/data/corrupted.numbers"], print_result=False
)
ret = script_runner.run(["cat-numbers", "tests/data/corrupted.numbers"], print_result=False)
assert not ret.success
assert "Index/Metadata.iwa: invalid" in ret.stderr
assert ret.stdout == ""
4 changes: 1 addition & 3 deletions tests/test_protobuf_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ def test_protobuf_versions(virtualenv):
virtualenv.run(["pip", "install", f"{SOURCE_DIR}/{wheel}"])

for protobuf_version in PROTOBUF_VERSIONS:
virtualenv.install_package(
"protobuf", version=protobuf_version, installer="pip"
)
virtualenv.install_package("protobuf", version=protobuf_version, installer="pip")
pip_output = virtualenv.run(["pip", "show", "protobuf"], capture=True)
match = re.search(f"Version: {protobuf_version}", pip_output)
assert match is not None
Expand Down
17 changes: 3 additions & 14 deletions tests/test_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,8 @@ def test_header_styles():
assert all([table.cell(ref).style.italic for ref in ["B1", "B4", "B9"]])
assert all([table.cell(ref).style.strikethrough for ref in ["D1", "A5", "D9"]])

assert all(
[
table.cell(ref).style.font_color == RGB(29, 177, 0)
for ref in ["A2", "A6", "A10"]
]
)
assert all(
[
table.cell(ref).style.bg_color == RGB(29, 177, 0)
for ref in ["B2", "B6", "B10"]
]
)
assert all([table.cell(ref).style.font_color == RGB(29, 177, 0) for ref in ["A2", "A6", "A10"]])
assert all([table.cell(ref).style.bg_color == RGB(29, 177, 0) for ref in ["B2", "B6", "B10"]])
assert all(
[
table.cell(ref).style.bg_color == [RGB(136, 250, 78), RGB(1, 113, 0)]
Expand All @@ -244,8 +234,7 @@ def test_header_styles():
)
assert all(
[
table.cell(ref).style.bg_image.filename
== "pexels-evg-kowalievska-1170986-16.jpg"
table.cell(ref).style.bg_image.filename == "pexels-evg-kowalievska-1170986-16.jpg"
for ref in ["D2", "E2", "B7", "C7", "D10", "E10"]
]
)
Expand Down
14 changes: 3 additions & 11 deletions tests/test_unpack_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def test_help(script_runner):


def test_multi_doc_error(script_runner):
ret = script_runner.run(
["unpack-numbers", "--output", "tmp", "foo", "bar"], print_result=False
)
ret = script_runner.run(["unpack-numbers", "--output", "tmp", "foo", "bar"], print_result=False)
assert not ret.success
assert ret.stdout == ""
assert "output directory only valid" in ret.stderr
Expand Down Expand Up @@ -125,15 +123,9 @@ def test_pretty_storage(script_runner, tmp_path):
objects = data["chunks"][0]["archives"][0]["objects"][0]
assert objects["rowInfos"][0]["cell_offsets"] == "-1,0,24,48,72,96,[...]"
if sys.version_info.minor >= 8:
assert (
objects["rowInfos"][0]["cell_storage_buffer"][0:26]
== "05:03:00:00:00:00:00:00:08"
)
assert objects["rowInfos"][0]["cell_storage_buffer"][0:26] == "05:03:00:00:00:00:00:00:08"
else:
assert (
objects["rowInfos"][0]["cell_storage_buffer"][0:26]
== "05030000000000000810020002"
)
assert objects["rowInfos"][0]["cell_storage_buffer"][0:26] == "05030000000000000810020002"


def test_compact_json(script_runner, tmp_path):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def test_numbers_version_check():
assert _check_installed_numbers_version() is None

with mock.patch("builtins.open", side_effect=mock_newer_plist):
with pytest.warns(
match="Numbers version 99.0 not tested with this version"
) as record:
with pytest.warns(match="Numbers version 99.0 not tested with this version") as record:
import numbers_parser

importlib.reload(numbers_parser)
Expand Down

0 comments on commit bf2e5a6

Please sign in to comment.