diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/12_test_deb.py | 6 | ||||
-rw-r--r-- | tests/14_test_gbp_import_dscs.py | 14 |
2 files changed, 11 insertions, 9 deletions
diff --git a/tests/12_test_deb.py b/tests/12_test_deb.py index 8a35ac5f..d46f987c 100644 --- a/tests/12_test_deb.py +++ b/tests/12_test_deb.py @@ -7,6 +7,8 @@ from . import context import os, tempfile, unittest import gbp.deb + +from gbp.deb.dscfile import DscFile from gbp.command_wrappers import CommandExecFailed class TestDscFile(unittest.TestCase): @@ -51,9 +53,9 @@ Files: def tearDown(self): os.unlink(self.dscfile.name) - def test_parse_dsc_file(self): + def test_dscfile_parse(self): """Test parsing a valid dsc file""" - dsc = gbp.deb.parse_dsc(self.dscfile.name) + dsc = DscFile.parse(self.dscfile.name) self.assertEqual(dsc.version, '0.9.12-4') 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 """ |