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

Commitff3d142

Browse files
committed
test_base: Improved basic object creation as well as set hash tests
1 parentbeb76ab commitff3d142

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎test/git/test_base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ def setup(self):
2424

2525
deftest_base_object(self):
2626
# test interface of base object classes
27-
fcreators= (self.repo.blob,self.repo.tree,self.repo.commit,lambdaid:TagObject(self.repo,id))
28-
assertlen(fcreators)==len(self.type_tuples)
27+
types= (Blob,Tree,Commit,TagObject)
28+
assertlen(types)==len(self.type_tuples)
2929

3030
s=set()
3131
num_objs=0
3232
num_index_objs=0
33-
forfcreator, (typename,hexsha)inzip(fcreators,self.type_tuples):
34-
item=fcreator(hexsha)
33+
forobj_type, (typename,hexsha)inzip(types,self.type_tuples):
34+
item=obj_type(self.repo,hexsha)
3535
num_objs+=1
3636
assertitem.id==hexsha
3737
assertitem.type==typename
@@ -53,6 +53,7 @@ def test_base_object(self):
5353

5454
# each has a unique sha
5555
assertlen(s)==num_objs
56+
assertlen(s|s)==num_objs
5657
assertnum_index_objs==2
5758

5859

@@ -70,6 +71,7 @@ def test_tags(self):
7071
s.add(ref)
7172
# END for each ref
7273
assertlen(s)==ref_count
74+
assertlen(s|s)==ref_count
7375

7476
deftest_get_object_type_by_name(self):
7577
fortnameinbase.Object.TYPES:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp