Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7076f43

Browse files
committed
Fixed submodule tests to go with either the old or the new version of gitdb
1 parent095013f commit7076f43

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

‎.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "git/ext/async"]
2-
path=git/ext/async
3-
url=git://github.com/gitpython-developers/async.git
1+
[submodule "gitdb"]
2+
path=git/ext/gitdb
3+
url=git://github.com/gitpython-developers/gitdb.git

‎git/test/objects/test_submodule.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,11 @@ def _do_base_tests(self, rwrepo):
284284
self.failUnlessRaises(InvalidGitRepositoryError,sm.remove)
285285

286286
# forcibly delete the child repository
287+
prev_count=len(sm.children())
287288
assertcsm.remove(force=True)iscsm
288289
assertnotcsm.exists()
289290
assertnotcsm.module_exists()
290-
assertlen(sm.children())==0
291+
assertlen(sm.children())==prev_count-1
291292
# now we have a changed index, as configuration was altered.
292293
# fix this
293294
sm.module().index.reset(working_tree=True)
@@ -411,7 +412,7 @@ def test_root_module(self, rwrepo):
411412

412413
# deep traversal git / async
413414
rsmsp= [sm.pathforsminrm.traverse()]
414-
assertlen(rsmsp)==1# git andasync, async being a child of git
415+
assertlen(rsmsp)==2# git,async,smmap,async being a child of git.
415416

416417
# cannot set the parent commit as root module's path didn't exist
417418
self.failUnlessRaises(ValueError,rm.set_parent_commit,'HEAD')
@@ -564,13 +565,13 @@ def test_root_module(self, rwrepo):
564565
# =================
565566
# finally we recursively update a module, just to run the code at least once
566567
# remove the module so that it has more work
567-
assertlen(nsm.children())==1
568-
assertnsm.exists()andnsm.module_exists()andlen(nsm.children())==1
568+
assertlen(nsm.children())>=1# could include smmap
569+
assertnsm.exists()andnsm.module_exists()andlen(nsm.children())>=1
569570
# assure we pull locally only
570571
nsmc=nsm.children()[0]
571572
nsmc.config_writer().set_value('url',async_url)
572573
rm.update(recursive=True,progress=prog,dry_run=True)# just to run the code
573574
rm.update(recursive=True,progress=prog)
574575

575-
assertlen(nsm.children())==1andnsmc.module_exists()
576+
assertlen(nsm.children())>=2andnsmc.module_exists()
576577

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp