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

Commit4a8bdce

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

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

‎.gitmodules

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

‎git/test/test_submodule.py

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

264264
# forcibly delete the child repository
265+
prev_count=len(sm.children())
265266
assertcsm.remove(force=True)iscsm
266267
assertnotcsm.exists()
267268
assertnotcsm.module_exists()
268-
assertlen(sm.children())==0
269+
assertlen(sm.children())==prev_count-1
269270
# now we have a changed index, as configuration was altered.
270271
# fix this
271272
sm.module().index.reset(working_tree=True)
@@ -389,7 +390,7 @@ def test_root_module(self, rwrepo):
389390

390391
# deep traversal gitdb / async
391392
rsmsp= [sm.pathforsminrm.traverse()]
392-
assertlen(rsmsp)==2# gitdb and async, async being a child of gitdb
393+
assertlen(rsmsp)>=2# gitdb and async [and smmap], async being a child of gitdb
393394

394395
# cannot set the parent commit as root module's path didn't exist
395396
self.failUnlessRaises(ValueError,rm.set_parent_commit,'HEAD')
@@ -538,13 +539,13 @@ def test_root_module(self, rwrepo):
538539
# =================
539540
# finally we recursively update a module, just to run the code at least once
540541
# remove the module so that it has more work
541-
assertlen(nsm.children())==1
542-
assertnsm.exists()andnsm.module_exists()andlen(nsm.children())==1
542+
assertlen(nsm.children())>=1# could include smmap
543+
assertnsm.exists()andnsm.module_exists()andlen(nsm.children())>=1
543544
# assure we pull locally only
544545
nsmc=nsm.children()[0]
545546
nsmc.config_writer().set_value('url',async_url)
546547
rm.update(recursive=True,progress=prog,dry_run=True)# just to run the code
547548
rm.update(recursive=True,progress=prog)
548549

549-
assertlen(nsm.children())==1andnsmc.module_exists()
550+
assertlen(nsm.children())>=2andnsmc.module_exists()
550551

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp