2424# Boston, MA 02110-1301, USA.
2525
2626import pygit2
27+ from pygit2 import Blob , Repository
2728
2829expected_diff = b"""diff --git a/iso-8859-1.txt b/iso-8859-1.txt
2930index e84e339..201e0c9 100644
3536"""
3637
3738
38- def test_patch_from_non_utf8 ():
39+ def test_patch_from_non_utf8 () -> None :
3940 # blobs encoded in ISO-8859-1
4041 old_content = b'Kristian H\xf8 gsberg\n '
4142 new_content = old_content + b'foo\n '
@@ -54,10 +55,14 @@ def test_patch_from_non_utf8():
5455 assert patch .text .encode ('utf-8' ) != expected_diff
5556
5657
57- def test_patch_create_from_blobs (encodingrepo ):
58+ def test_patch_create_from_blobs (encodingrepo : Repository ) -> None :
59+ old_content = encodingrepo ['e84e339ac7fcc823106efa65a6972d7a20016c85' ]
60+ new_content = encodingrepo ['201e0c908e3d9f526659df3e556c3d06384ef0df' ]
61+ assert isinstance (old_content , Blob )
62+ assert isinstance (new_content , Blob )
5863 patch = pygit2 .Patch .create_from (
59- encodingrepo [ 'e84e339ac7fcc823106efa65a6972d7a20016c85' ] ,
60- encodingrepo [ '201e0c908e3d9f526659df3e556c3d06384ef0df' ] ,
64+ old_content ,
65+ new_content ,
6166 old_as_path = 'iso-8859-1.txt' ,
6267 new_as_path = 'iso-8859-1.txt' ,
6368 )
0 commit comments