From 0f88fb96869b6ac3ed4dac7d23310a9327d3c89c Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 15 Oct 2010 11:56:28 +0200 Subject: 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 --- lib/git/ext/gitdb | 2 +- test/git/performance/test_odb.py | 5 +++-- test/git/test_commit.py | 9 +++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/git/ext/gitdb b/lib/git/ext/gitdb index 425ecf04..78665b13 160000 --- a/lib/git/ext/gitdb +++ b/lib/git/ext/gitdb @@ -1 +1 @@ -Subproject commit 425ecf04aa5038c3d46b01ca20de17c51ef6c4e5 +Subproject commit 78665b13ff4125f4ce3e5311d040c027bdc92a9a diff --git a/test/git/performance/test_odb.py b/test/git/performance/test_odb.py index 23d5b98e..32b70f69 100644 --- a/test/git/performance/test_odb.py +++ b/test/git/performance/test_odb.py @@ -49,9 +49,10 @@ class TestObjDBPerformance(TestBigRepoR): st = time() nb = 0 too_many = 15000 + data_bytes = 0 for blob_list in blobs_per_commit: for blob in blob_list: - blob.data_stream.read() + data_bytes += len(blob.data_stream.read()) # END for each blobsha nb += len(blob_list) if nb > too_many: @@ -59,7 +60,7 @@ class TestObjDBPerformance(TestBigRepoR): # END for each bloblist elapsed = time() - st - print >> sys.stderr, "%s: Retrieved %i blob and their data in %g s ( %f blobs / s )" % (type(repo.odb), nb, elapsed, nb / elapsed) + 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) results[2].append(elapsed) # END for each repo type diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 31ce2c4e..a9ea7f98 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # test_commit.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # @@ -108,6 +109,14 @@ class TestCommit(TestBase): assert commit.committer_tz_offset == 14400, commit.committer_tz_offset assert commit.message == "initial project\n" + def test_unicode_actor(self): + # assure we can parse unicode actors correctly + name = "Üäöß ÄußÉ".decode("utf-8") + assert len(name) == 9 + special = Actor._from_string(u"%s " % name) + assert special.name == name + assert isinstance(special.name, unicode) + def test_traversal(self): start = self.rorepo.commit("a4d06724202afccd2b5c54f81bcf2bf26dea7fff") first = self.rorepo.commit("33ebe7acec14b25c5f84f35a664803fcab2f7781") -- cgit v1.2.1