diff --git a/tests/test_glyph_file_util.py b/tests/test_glyph_file_util.py index bc5771a..0597d3c 100644 --- a/tests/test_glyph_file_util.py +++ b/tests/test_glyph_file_util.py @@ -17,7 +17,7 @@ def test_glyph_file_1(): def test_glyph_file_2(): with pytest.raises(ValueError) as info: - glyph_file = GlyphFile.load(Path('notdef a,b.png')) + GlyphFile.load(Path('notdef a,b.png')) assert info.value.args[0] == "'notdef' can't have flavors: 'notdef a,b.png'" @@ -29,7 +29,7 @@ def test_glyph_file_3(): def test_glyph_file_4(): - glyph_file = GlyphFile.load(Path('4E00 a,b,c,b,a.png')) + glyph_file = GlyphFile.load(Path('4E00 A,b,C,b,a.png')) assert glyph_file.code_point == 0x4E00 assert glyph_file.flavors == ['a', 'b', 'c'] assert glyph_file.glyph_name == '4E00-A' diff --git a/tests/test_mono_bitmap.py b/tests/test_mono_bitmap.py index fd29570..b94ed49 100644 --- a/tests/test_mono_bitmap.py +++ b/tests/test_mono_bitmap.py @@ -1,4 +1,3 @@ -import hashlib from io import BytesIO from pathlib import Path @@ -7,10 +6,6 @@ from pixel_font_knife.mono_bitmap import MonoBitmap -def _sha256(data: bytes) -> str: - return hashlib.sha256(data).hexdigest() - - def test_init(): bitmap = MonoBitmap([ [0, 1, 2, 3], @@ -235,13 +230,13 @@ def test_load_dump_save(glyphs_dir: Path, tmp_path: Path): black_bitmap.save_png(black_save_path) black_stream = BytesIO() black_bitmap.dump_png(black_stream) - assert _sha256(black_load_path.read_bytes()) == _sha256(black_save_path.read_bytes()) == _sha256(black_stream.getvalue()) + assert black_load_path.read_bytes() == black_save_path.read_bytes() == black_stream.getvalue() red_save_path = red_save_dir.joinpath(red_load_path.name) red_bitmap.save_png(red_save_path, color=(255, 0, 0)) red_stream = BytesIO() red_bitmap.dump_png(red_stream, color=(255, 0, 0)) - assert _sha256(red_load_path.read_bytes()) == _sha256(red_save_path.read_bytes()) == _sha256(red_stream.getvalue()) + assert red_load_path.read_bytes() == red_save_path.read_bytes() == red_stream.getvalue() def test_bold_s4_r1_e1(glyphs_dir: Path):