mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-19 22:31:07 +00:00
test: Fix deprecated return value for test case
``` ubuntutools/test/test_archive.py::LocalSourcePackageTestCase::test_pull /usr/lib/python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value that is not None from a test case (<bound method LocalSourcePackageTestCase.test_pull of <ubuntutools.test.test_archive.LocalSourcePackageTestCase testMethod=test_pull>>) return self.run(*args, **kwds) ``` `test_pull` does not need to be run directly. Make it private. Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
parent
aa556af89d
commit
21784052ba
@ -75,7 +75,7 @@ class LocalSourcePackageTestCase(BaseVerificationTestCase):
|
||||
srcpkg.pull()
|
||||
return srcpkg
|
||||
|
||||
def test_pull(self, **kwargs):
|
||||
def _test_pull(self, **kwargs):
|
||||
srcpkg = self.pull(**kwargs)
|
||||
self.assertTrue(filecmp.cmp(self.pkg.dsc, self.workdir / self.pkg.dsc.name))
|
||||
self.assertTrue(filecmp.cmp(self.pkg.orig, self.workdir / self.pkg.orig.name))
|
||||
@ -92,7 +92,7 @@ class LocalSourcePackageTestCase(BaseVerificationTestCase):
|
||||
self.assertTrue(debian.is_dir())
|
||||
|
||||
def test_pull_and_unpack(self, **kwargs):
|
||||
self.test_unpack(srcpkg=self.test_pull(**kwargs))
|
||||
self.test_unpack(srcpkg=self._test_pull(**kwargs))
|
||||
|
||||
def test_with_package(self):
|
||||
self.test_pull_and_unpack(package=self.pkg.source)
|
||||
@ -117,7 +117,7 @@ class LocalSourcePackageTestCase(BaseVerificationTestCase):
|
||||
testfile.write_bytes(corruption)
|
||||
self.assertEqual(testfile.read_bytes(), corruption)
|
||||
|
||||
self.test_pull()
|
||||
self._test_pull()
|
||||
self.assertTrue(testfile.exists())
|
||||
self.assertTrue(testfile.is_file())
|
||||
self.assertNotEqual(testfile.read_bytes(), corruption)
|
||||
|
Loading…
x
Reference in New Issue
Block a user