From 77b810b5a6bbcd169e199564d28286a84507529c Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sun, 31 Mar 2019 11:16:56 -0700 Subject: [PATCH] Update PackageManager method names --- rbackup/package_managers/packagemanager.py | 8 ++------ rbackup/tests/test_packagemanager.py | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rbackup/package_managers/packagemanager.py b/rbackup/package_managers/packagemanager.py index e657f27..02e4bea 100644 --- a/rbackup/package_managers/packagemanager.py +++ b/rbackup/package_managers/packagemanager.py @@ -43,11 +43,7 @@ class PackageManager: self._db_path = Path(db_path) self._pkglist_cmd = pkglist_cmd - def __init_subclass__(cls, cachedir, db_path, pkglist_cmd): - """Default constructor for all child classes.""" - super().__init_subclass(cachedir, db_path, pkglist_cmd) - - def _gen_pkglist(self): + def gen_pkglist(self): """Generate a text file listing installed packages on the system and return the path to that file. @@ -74,7 +70,7 @@ class PackageManager: syslog.info("Package list generation complete") return Path(pkglist.name) - def _gen_db_archive(self, *args, **kwargs): + def gen_db_archive(self, compress=None): """Generate a database archive for this package manager. Note that this method is internal and is diff --git a/rbackup/tests/test_packagemanager.py b/rbackup/tests/test_packagemanager.py index 38c2da5..e19445b 100644 --- a/rbackup/tests/test_packagemanager.py +++ b/rbackup/tests/test_packagemanager.py @@ -102,7 +102,7 @@ class TestPackageManagerMethods(unittest.TestCase): self.mocked_run.return_value.stdout = "packages" self.mocked_tempfile.return_value.name = "tempfile" - pkglist = self.p._gen_pkglist() + pkglist = self.p.gen_pkglist() self.mocked_tempfile.return_value.__enter__.return_value.write.assert_called_with( "packages" @@ -112,7 +112,7 @@ class TestPackageManagerMethods(unittest.TestCase): def test_pkglist_subprocess_error(self): self.mocked_run.side_effect = subprocess.CalledProcessError(1, self.pkglist_cmd) - self.p._gen_pkglist() + self.p.gen_pkglist() self.mocked_tempfile.assert_not_called() def test_db_archive(self):