Skip to content

Commit b697dce

Browse files
committed
And now with correct formatting.
1 parent 597f157 commit b697dce

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

python/example-pytest-selfie/tests/binary_test.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import base64
2-
import os
3-
41
import pytest
52
from selfie_lib import expect_selfie
63

4+
75
def test_empty_binary_base64():
86
"""Test base64 encoding of empty byte array"""
97
expect_selfie(bytes()).to_be_base64("")
@@ -25,13 +23,20 @@ def test_binary_file():
2523

2624
def test_binary_file_duplicate_equal():
2725
"""Test writing same binary data to a file multiple times"""
28-
expect_selfie(b"equal").to_be_file("tests/binary_test__test_binary_file_duplicate_equal.bin")
29-
expect_selfie(b"equal").to_be_file("tests/binary_test__test_binary_file_duplicate_equal.bin")
26+
expect_selfie(b"equal").to_be_file(
27+
"tests/binary_test__test_binary_file_duplicate_equal.bin"
28+
)
29+
expect_selfie(b"equal").to_be_file(
30+
"tests/binary_test__test_binary_file_duplicate_equal.bin"
31+
)
32+
3033

3134
def test_binary_file_mismatch():
3235
"""Test error handling for mismatched binary data"""
3336
with pytest.raises(AssertionError):
34-
expect_selfie(b"different").to_be_file("tests/binary_test__SHOULD_NOT_EXIST.bin")
37+
expect_selfie(b"different").to_be_file(
38+
"tests/binary_test__SHOULD_NOT_EXIST.bin"
39+
)
3540

3641

3742
def test_binary_file_not_found():
@@ -45,6 +50,8 @@ def test_base64_mismatch():
4550
"""Test error handling for mismatched base64 data"""
4651
with pytest.raises(Exception) as exc_info:
4752
expect_selfie(b"test data").to_be_base64("AAAA")
48-
expect_selfie(str(exc_info.value)).to_be("""Snapshot mismatch, TODO: string comparison
53+
expect_selfie(
54+
str(exc_info.value)
55+
).to_be("""Snapshot mismatch, TODO: string comparison
4956
- update this snapshot by adding `_TODO` to the function name
50-
- update all snapshots in this file by adding `#selfieonce` or `#SELFIEWRITE`""")
57+
- update all snapshots in this file by adding `#selfieonce` or `#SELFIEWRITE`""")

0 commit comments

Comments
 (0)