test(services): clean up tests

This commit is contained in:
Houkime 2024-03-04 17:37:26 +00:00 committed by Inex Code
parent fd43a6ccf1
commit 7dae81530e
3 changed files with 1 additions and 29 deletions

View file

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

View file

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

View file

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