@@ -76,7 +76,7 @@ def _print_fetchhead(self, repo):
76
76
fp .close ()
77
77
78
78
79
- def _test_fetch_result (self , results , remote ):
79
+ def _do_test_fetch_result (self , results , remote ):
80
80
# self._print_fetchhead(remote.repo)
81
81
assert len (results ) > 0 and isinstance (results [0 ], FetchInfo )
82
82
for info in results :
@@ -92,7 +92,7 @@ def _test_fetch_result(self, results, remote):
92
92
# END forced update checking
93
93
# END for each info
94
94
95
- def _test_push_result (self , results , remote ):
95
+ def _do_test_push_result (self , results , remote ):
96
96
assert len (results ) > 0 and isinstance (results [0 ], PushInfo )
97
97
for info in results :
98
98
assert info .flags
@@ -116,7 +116,7 @@ def _test_push_result(self, results, remote):
116
116
# END for each info
117
117
118
118
119
- def _test_fetch_info (self , repo ):
119
+ def _do_test_fetch_info (self , repo ):
120
120
self .failUnlessRaises (ValueError , FetchInfo ._from_line , repo , "nonsense" , '' )
121
121
self .failUnlessRaises (ValueError , FetchInfo ._from_line , repo , "? [up to date] 0.1.7RC -> origin/0.1.7RC" , '' )
122
122
@@ -129,16 +129,16 @@ def _commit_random_file(self, repo):
129
129
index .commit ("Committing %s" % new_file )
130
130
return new_file
131
131
132
- def _test_fetch (self ,remote , rw_repo , remote_repo ):
132
+ def _do_test_fetch (self ,remote , rw_repo , remote_repo ):
133
133
# specialized fetch testing to de-clutter the main test
134
- self ._test_fetch_info (rw_repo )
134
+ self ._do_test_fetch_info (rw_repo )
135
135
136
136
def fetch_and_test (remote , ** kwargs ):
137
137
progress = TestRemoteProgress ()
138
138
kwargs ['progress' ] = progress
139
139
res = remote .fetch (** kwargs )
140
140
progress .make_assertion ()
141
- self ._test_fetch_result (res , remote )
141
+ self ._do_test_fetch_result (res , remote )
142
142
return res
143
143
# END fetch and check
144
144
@@ -273,21 +273,21 @@ def _test_push_and_pull(self,remote, rw_repo, remote_repo):
273
273
progress = TestRemoteProgress ()
274
274
res = remote .push (lhead .reference , progress )
275
275
assert isinstance (res , IterableList )
276
- self ._test_push_result (res , remote )
276
+ self ._do_test_push_result (res , remote )
277
277
progress .make_assertion ()
278
278
279
279
# rejected - undo last commit
280
280
lhead .reset ("HEAD~1" )
281
281
res = remote .push (lhead .reference )
282
282
assert res [0 ].flags & PushInfo .ERROR
283
283
assert res [0 ].flags & PushInfo .REJECTED
284
- self ._test_push_result (res , remote )
284
+ self ._do_test_push_result (res , remote )
285
285
286
286
# force rejected pull
287
287
res = remote .push ('+%s' % lhead .reference )
288
288
assert res [0 ].flags & PushInfo .ERROR == 0
289
289
assert res [0 ].flags & PushInfo .FORCED_UPDATE
290
- self ._test_push_result (res , remote )
290
+ self ._do_test_push_result (res , remote )
291
291
292
292
# invalid refspec
293
293
res = remote .push ("hellothere" )
@@ -301,13 +301,13 @@ def _test_push_and_pull(self,remote, rw_repo, remote_repo):
301
301
res = remote .push (progress = progress , tags = True )
302
302
assert res [- 1 ].flags & PushInfo .NEW_TAG
303
303
progress .make_assertion ()
304
- self ._test_push_result (res , remote )
304
+ self ._do_test_push_result (res , remote )
305
305
306
306
# update push new tags
307
307
# Rejection is default
308
308
new_tag = TagReference .create (rw_repo , to_be_updated , ref = 'HEAD~1' , force = True )
309
309
res = remote .push (tags = True )
310
- self ._test_push_result (res , remote )
310
+ self ._do_test_push_result (res , remote )
311
311
assert res [- 1 ].flags & PushInfo .REJECTED and res [- 1 ].flags & PushInfo .ERROR
312
312
313
313
# push force this tag
@@ -316,7 +316,7 @@ def _test_push_and_pull(self,remote, rw_repo, remote_repo):
316
316
317
317
# delete tag - have to do it using refspec
318
318
res = remote .push (":%s" % new_tag .path )
319
- self ._test_push_result (res , remote )
319
+ self ._do_test_push_result (res , remote )
320
320
assert res [0 ].flags & PushInfo .DELETED
321
321
progress .assert_received_message ()
322
322
@@ -326,17 +326,17 @@ def _test_push_and_pull(self,remote, rw_repo, remote_repo):
326
326
res = remote .push (new_head , progress )
327
327
assert res [0 ].flags & PushInfo .NEW_HEAD
328
328
progress .make_assertion ()
329
- self ._test_push_result (res , remote )
329
+ self ._do_test_push_result (res , remote )
330
330
331
331
# delete new branch on the remote end and locally
332
332
res = remote .push (":%s" % new_head .path )
333
- self ._test_push_result (res , remote )
333
+ self ._do_test_push_result (res , remote )
334
334
Head .delete (rw_repo , new_head )
335
335
assert res [- 1 ].flags & PushInfo .DELETED
336
336
337
337
# --all
338
338
res = remote .push (all = True )
339
- self ._test_push_result (res , remote )
339
+ self ._do_test_push_result (res , remote )
340
340
341
341
remote .pull ('master' )
342
342
@@ -405,7 +405,7 @@ def test_base(self, rw_repo, remote_repo):
405
405
# Only for remotes - local cases are the same or less complicated
406
406
# as additional progress information will never be emitted
407
407
if remote .name == "daemon_origin" :
408
- self ._test_fetch (remote , rw_repo , remote_repo )
408
+ self ._do_test_fetch (remote , rw_repo , remote_repo )
409
409
ran_fetch_test = True
410
410
# END fetch test
411
411
0 commit comments