mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-15 23:23:17 +00:00
test(services): test derivation of foldermoves
This commit is contained in:
parent
ba72fadb8d
commit
dde86725b9
|
@ -24,7 +24,7 @@ class FolderMoveNames(BaseModel):
|
|||
@staticmethod
|
||||
def from_owned_path(path: OwnedPath) -> FolderMoveNames:
|
||||
return FolderMoveNames(
|
||||
name=FolderMoveNames.get_foldername(),
|
||||
name=FolderMoveNames.get_foldername(path.path),
|
||||
bind_location=path.path,
|
||||
owner=path.owner,
|
||||
group=path.group,
|
||||
|
|
|
@ -6,6 +6,7 @@ from pytest import raises
|
|||
from selfprivacy_api.services.bitwarden import Bitwarden
|
||||
from selfprivacy_api.services.pleroma import Pleroma
|
||||
from selfprivacy_api.services.owned_path import OwnedPath
|
||||
from selfprivacy_api.services.generic_service_mover import FolderMoveNames
|
||||
|
||||
from selfprivacy_api.services.test_service import DummyService
|
||||
from selfprivacy_api.services.service import Service
|
||||
|
@ -40,3 +41,18 @@ def test_paths_from_owned_paths():
|
|||
assert Pleroma.get_folders() == [
|
||||
ownedpath.path for ownedpath in Pleroma.get_owned_folders()
|
||||
]
|
||||
|
||||
|
||||
def test_foldermoves_from_ownedpaths():
|
||||
owned = OwnedPath(
|
||||
path="var/lib/bitwarden",
|
||||
group="vaultwarden",
|
||||
owner="vaultwarden",
|
||||
)
|
||||
|
||||
assert FolderMoveNames.from_owned_path(owned) == FolderMoveNames(
|
||||
name="bitwarden",
|
||||
bind_location="var/lib/bitwarden",
|
||||
group="vaultwarden",
|
||||
owner="vaultwarden",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue