summaryrefslogtreecommitdiffhomepage
path: root/tests/14_test_gbp_import_dscs.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-04-29 20:55:40 +0200
committerGuido Günther <agx@sigxcpu.org>2013-04-29 21:14:18 +0200
commit43e60bb76e80c6ca7be1ee1da582fe78c5465349 (patch)
tree415cea02d452df14d26c25344601c7be3b03fe9b /tests/14_test_gbp_import_dscs.py
parent45c2346f6a52aec196dd89b8d09d8b06d05b8867 (diff)
Make parse_dsc a classmethod of DscFile
so we have the object creation close to the object itself.
Diffstat (limited to 'tests/14_test_gbp_import_dscs.py')
-rw-r--r--tests/14_test_gbp_import_dscs.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/14_test_gbp_import_dscs.py b/tests/14_test_gbp_import_dscs.py
index 3e4772fa..9482ea8d 100644
--- a/tests/14_test_gbp_import_dscs.py
+++ b/tests/14_test_gbp_import_dscs.py
@@ -45,16 +45,16 @@ class DscStub(object):
self.filename = filename
self.version = version
-def stub_parse_dsc(filename):
- # filename is like file1.dsc, file2.dsc, use
- # the digit as version number
- version = filename[4]
- return DscStub(filename, version)
-
+ @classmethod
+ def parse(cls, filename):
+ # filename is like file1.dsc, file2.dsc, use
+ # the digit as version number
+ version = filename[4]
+ return cls(filename, version)
# hook up stubs
import_dscs.GitImportDsc = StubGitImportDsc
-import_dscs.parse_dsc = stub_parse_dsc
+import_dscs.DscFile = DscStub
class TestImportDscs(testutils.DebianGitTestRepo):
"""Test L{gbp.scripts.import_dscs}'s """