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

Commit0f88fb9

Browse files
committed
Added test to verify the actor type can handle and parse unicode if it is passed in
test_odb: added more information to the message output
1 parent741dfaa commit0f88fb9

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

‎lib/git/ext/gitdb

Submodule gitdb updated from 425ecf0 to 78665b1

‎test/git/performance/test_odb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ def test_random_access(self):
4949
st=time()
5050
nb=0
5151
too_many=15000
52+
data_bytes=0
5253
forblob_listinblobs_per_commit:
5354
forblobinblob_list:
54-
blob.data_stream.read()
55+
data_bytes+=len(blob.data_stream.read())
5556
# END for each blobsha
5657
nb+=len(blob_list)
5758
ifnb>too_many:
5859
break
5960
# END for each bloblist
6061
elapsed=time()-st
6162

62-
print>>sys.stderr,"%s: Retrieved %i blob and their data in %g s ( %f blobs / s)"% (type(repo.odb),nb,elapsed,nb/elapsed)
63+
print>>sys.stderr,"%s: Retrieved %i blob(%i KiB)and their data in %g s ( %f blobs / s, %f KiB / s)"% (type(repo.odb),nb,data_bytes/1000,elapsed,nb/elapsed, (data_bytes/1000)/elapsed)
6364
results[2].append(elapsed)
6465
# END for each repo type
6566

‎test/git/test_commit.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
# test_commit.py
23
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
34
#
@@ -108,6 +109,14 @@ def check_entries(d):
108109
assertcommit.committer_tz_offset==14400,commit.committer_tz_offset
109110
assertcommit.message=="initial project\n"
110111

112+
deftest_unicode_actor(self):
113+
# assure we can parse unicode actors correctly
114+
name="Üäöß ÄußÉ".decode("utf-8")
115+
assertlen(name)==9
116+
special=Actor._from_string(u"%s <something@this.com>"%name)
117+
assertspecial.name==name
118+
assertisinstance(special.name,unicode)
119+
111120
deftest_traversal(self):
112121
start=self.rorepo.commit("a4d06724202afccd2b5c54f81bcf2bf26dea7fff")
113122
first=self.rorepo.commit("33ebe7acec14b25c5f84f35a664803fcab2f7781")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp