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:
Benjamin Drung 2023-01-31 17:39:12 +01:00
parent aa556af89d
commit 21784052ba

View File

@ -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)