23
23
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
24
24
# Boston, MA 02110-1301, USA.
25
25
26
- from unittest .mock import patch
27
26
import sys
28
27
29
28
import pytest
@@ -50,7 +49,7 @@ def test_remote_create(testrepo):
50
49
51
50
remote = testrepo .remotes .create (name , url )
52
51
53
- assert type (remote ) == pygit2 .Remote
52
+ assert type (remote ) is pygit2 .Remote
54
53
assert name == remote .name
55
54
assert url == remote .url
56
55
assert remote .push_url is None
@@ -66,7 +65,7 @@ def test_remote_create_with_refspec(testrepo):
66
65
67
66
remote = testrepo .remotes .create (name , url , fetch )
68
67
69
- assert type (remote ) == pygit2 .Remote
68
+ assert type (remote ) is pygit2 .Remote
70
69
assert name == remote .name
71
70
assert url == remote .url
72
71
assert [fetch ] == remote .fetch_refspecs
@@ -140,7 +139,7 @@ def test_refspec(testrepo):
140
139
assert refspec .force is True
141
140
assert ORIGIN_REFSPEC == refspec .string
142
141
143
- assert list == type (remote .fetch_refspecs )
142
+ assert list is type (remote .fetch_refspecs )
144
143
assert 1 == len (remote .fetch_refspecs )
145
144
assert ORIGIN_REFSPEC == remote .fetch_refspecs [0 ]
146
145
@@ -149,18 +148,18 @@ def test_refspec(testrepo):
149
148
assert 'refs/remotes/origin/master' == refspec .transform ('refs/heads/master' )
150
149
assert 'refs/heads/master' == refspec .rtransform ('refs/remotes/origin/master' )
151
150
152
- assert list == type (remote .push_refspecs )
151
+ assert list is type (remote .push_refspecs )
153
152
assert 0 == len (remote .push_refspecs )
154
153
155
154
push_specs = remote .push_refspecs
156
- assert list == type (push_specs )
155
+ assert list is type (push_specs )
157
156
assert 0 == len (push_specs )
158
157
159
158
testrepo .remotes .add_fetch ('origin' , '+refs/test/*:refs/test/remotes/*' )
160
159
remote = testrepo .remotes ['origin' ]
161
160
162
161
fetch_specs = remote .fetch_refspecs
163
- assert list == type (fetch_specs )
162
+ assert list is type (fetch_specs )
164
163
assert 2 == len (fetch_specs )
165
164
assert [
166
165
'+refs/heads/*:refs/remotes/origin/*' ,
0 commit comments