File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010from gitdb .exc import BadObject
1111from gitdb .db import GitDB
1212from gitdb .base import OStream , OInfo
13- from gitdb .util import hex_to_bin , bin_to_hex
13+ from gitdb .util import bin_to_hex
1414
1515
1616class TestGitDB (TestDBBase ):
@@ -22,7 +22,7 @@ def test_reading(self):
2222 assert 1 < len (gdb .databases ()) < 4
2323
2424 # access should be possible
25- gitdb_sha = hex_to_bin ( "5690fd0d3304f378754b23b098bd7cb5f4aa1976" )
25+ gitdb_sha = next ( gdb . sha_iter () )
2626 assert isinstance (gdb .info (gitdb_sha ), OInfo )
2727 assert isinstance (gdb .stream (gitdb_sha ), OStream )
2828 ni = 50
@@ -35,7 +35,8 @@ def test_reading(self):
3535 # have a separate test module
3636 # test partial shas
3737 # this one as uneven and quite short
38- assert gdb .partial_to_complete_sha_hex ('155b6' ) == hex_to_bin ("155b62a9af0aa7677078331e111d0f7aa6eb4afc" )
38+ gitdb_sha_hex = bin_to_hex (gitdb_sha )
39+ assert gdb .partial_to_complete_sha_hex (gitdb_sha_hex [:5 ]) == gitdb_sha
3940
4041 # mix even/uneven hexshas
4142 for i , binsha in enumerate (sha_list ):
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def test_writing(self, path):
4545 assert len (rdb .databases ()) == 1
4646
4747 # we should now find a default revision of ours
48- gitdb_sha = hex_to_bin ( "5690fd0d3304f378754b23b098bd7cb5f4aa1976" )
48+ gitdb_sha = next ( rdb . sha_iter () )
4949 assert rdb .has_object (gitdb_sha )
5050
5151 # remove valid
You can’t perform that action at this time.
0 commit comments