Add file/directory management

This commit is contained in:
Kivi Kaitaniemi
2024-04-25 23:02:17 +03:00
parent 0e22d22a69
commit 68b93a008c
11 changed files with 310 additions and 0 deletions
+9
View File
@@ -139,6 +139,8 @@ class TestSource(unittest.TestCase):
systemd_units=["1.service", "2.timer"],
systemd_user_units={"user": ["u1.service", "u2.timer"]},
modules=modules,
files={},
directories={},
)
store = Store()
@@ -151,6 +153,7 @@ class TestSource(unittest.TestCase):
"ExistingChanged": "1",
"Disabled": "1",
}
store.created_files = ["/test/file1", "/test/file2", "/test/file3"]
currently_installed_packages = [
"p1",
@@ -170,6 +173,12 @@ class TestSource(unittest.TestCase):
self.store = store
self.currently_installed_packages = currently_installed_packages
def test_files_to_remove(self):
created_files = ["/test/file1", "/test/file4"]
self.assertCountEqual(
self.source.files_to_remove(self.store, created_files),
["/test/file2", "/test/file3"])
def test_after_update_executed(self):
self.source.run_after_update()