1
- import base64
2
- import os
3
-
4
1
import pytest
5
2
from selfie_lib import expect_selfie
6
3
4
+
7
5
def test_empty_binary_base64 ():
8
6
"""Test base64 encoding of empty byte array"""
9
7
expect_selfie (bytes ()).to_be_base64 ("" )
@@ -25,13 +23,20 @@ def test_binary_file():
25
23
26
24
def test_binary_file_duplicate_equal ():
27
25
"""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
+
30
33
31
34
def test_binary_file_mismatch ():
32
35
"""Test error handling for mismatched binary data"""
33
36
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
+ )
35
40
36
41
37
42
def test_binary_file_not_found ():
@@ -45,6 +50,8 @@ def test_base64_mismatch():
45
50
"""Test error handling for mismatched base64 data"""
46
51
with pytest .raises (Exception ) as exc_info :
47
52
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
49
56
- 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