@@ -54,9 +54,9 @@ def test_read(testrepo):
54
54
55
55
sha = 'a520c24d85fbfc815d385957eed41406ca5a860b'
56
56
assert 'hello.txt' in index
57
- assert index ['hello.txt' ].hex == sha
57
+ assert index ['hello.txt' ].id == sha
58
58
assert index ['hello.txt' ].path == 'hello.txt'
59
- assert index [1 ].hex == sha
59
+ assert index [1 ].id == sha
60
60
61
61
62
62
def test_add (testrepo ):
@@ -67,7 +67,7 @@ def test_add(testrepo):
67
67
index .add ('bye.txt' )
68
68
assert 'bye.txt' in index
69
69
assert len (index ) == 3
70
- assert index ['bye.txt' ].hex == sha
70
+ assert index ['bye.txt' ].id == sha
71
71
72
72
73
73
def test_add_aspath (testrepo ):
@@ -90,26 +90,26 @@ def test_add_all(testrepo):
90
90
assert 'bye.txt' in index
91
91
assert 'hello.txt' in index
92
92
93
- assert index ['bye.txt' ].hex == sha_bye
94
- assert index ['hello.txt' ].hex == sha_hello
93
+ assert index ['bye.txt' ].id == sha_bye
94
+ assert index ['hello.txt' ].id == sha_hello
95
95
96
96
clear (testrepo )
97
97
98
98
index .add_all (['bye.t??' , 'hello.*' ])
99
99
assert 'bye.txt' in index
100
100
assert 'hello.txt' in index
101
101
102
- assert index ['bye.txt' ].hex == sha_bye
103
- assert index ['hello.txt' ].hex == sha_hello
102
+ assert index ['bye.txt' ].id == sha_bye
103
+ assert index ['hello.txt' ].id == sha_hello
104
104
105
105
clear (testrepo )
106
106
107
107
index .add_all (['[byehlo]*.txt' ])
108
108
assert 'bye.txt' in index
109
109
assert 'hello.txt' in index
110
110
111
- assert index ['bye.txt' ].hex == sha_bye
112
- assert index ['hello.txt' ].hex == sha_hello
111
+ assert index ['bye.txt' ].id == sha_bye
112
+ assert index ['hello.txt' ].id == sha_hello
113
113
114
114
115
115
def test_add_all_aspath (testrepo ):
@@ -163,8 +163,8 @@ def test_iter(testrepo):
163
163
assert len (list (index )) == n
164
164
165
165
# Compare SHAs, not IndexEntry object identity
166
- entries = [index [x ].hex for x in range (n )]
167
- assert list (x .hex for x in index ) == entries
166
+ entries = [index [x ].id for x in range (n )]
167
+ assert list (x .id for x in index ) == entries
168
168
169
169
170
170
def test_mode (testrepo ):
@@ -179,7 +179,7 @@ def test_mode(testrepo):
179
179
180
180
def test_bare_index (testrepo ):
181
181
index = pygit2 .Index (Path (testrepo .path ) / 'index' )
182
- assert [x .hex for x in index ] == [x .hex for x in testrepo .index ]
182
+ assert [x .id for x in index ] == [x .id for x in testrepo .index ]
183
183
184
184
with pytest .raises (pygit2 .GitError ):
185
185
index .add ('bye.txt' )
0 commit comments