mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 13:31:27 +00:00
test(services): clean up tests
This commit is contained in:
parent
fd43a6ccf1
commit
7dae81530e
|
@ -149,7 +149,7 @@ def volume_folders(tmpdir, mocker):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def raw_dummy_service(tmpdir):
|
def raw_dummy_service(tmpdir) -> DummyService:
|
||||||
dirnames = ["test_service", "also_test_service"]
|
dirnames = ["test_service", "also_test_service"]
|
||||||
service_dirs = []
|
service_dirs = []
|
||||||
for d in dirnames:
|
for d in dirnames:
|
||||||
|
|
|
@ -105,17 +105,6 @@ def mock_check_volume(mocker):
|
||||||
return mock
|
return mock
|
||||||
|
|
||||||
|
|
||||||
# TODO: remove
|
|
||||||
@pytest.fixture()
|
|
||||||
def mock_check_service_mover_binds(mocker):
|
|
||||||
mock = mocker.patch(
|
|
||||||
"selfprivacy_api.services.service.check_binds",
|
|
||||||
autospec=True,
|
|
||||||
return_value=None,
|
|
||||||
)
|
|
||||||
return mock
|
|
||||||
|
|
||||||
|
|
||||||
API_START_MUTATION = """
|
API_START_MUTATION = """
|
||||||
mutation TestStartService($service_id: String!) {
|
mutation TestStartService($service_id: String!) {
|
||||||
services {
|
services {
|
||||||
|
@ -631,8 +620,6 @@ def test_graphql_move_service_without_folders_on_old_volume(
|
||||||
def test_graphql_move_service(
|
def test_graphql_move_service(
|
||||||
authorized_client,
|
authorized_client,
|
||||||
generic_userdata,
|
generic_userdata,
|
||||||
# TODO: substitute with a weaker mock or delete altogether
|
|
||||||
mock_check_service_mover_binds,
|
|
||||||
mock_check_volume,
|
mock_check_volume,
|
||||||
dummy_service_with_binds,
|
dummy_service_with_binds,
|
||||||
):
|
):
|
||||||
|
|
|
@ -80,21 +80,6 @@ def test_paths_from_owned_paths():
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# 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",
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
def test_enabling_disabling_reads_json(dummy_service: DummyService):
|
def test_enabling_disabling_reads_json(dummy_service: DummyService):
|
||||||
with WriteUserData() as data:
|
with WriteUserData() as data:
|
||||||
data["modules"][dummy_service.get_id()]["enable"] = False
|
data["modules"][dummy_service.get_id()]["enable"] = False
|
||||||
|
|
Loading…
Reference in a new issue