From 15934b78817d2473915c834ab58bb9ddd26baa13 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Sat, 29 Jul 2023 17:37:07 +0300 Subject: [PATCH] dev Signed-off-by: Alexander Piskun --- tests/z_special_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/z_special_test.py b/tests/z_special_test.py index dc23036b..0d61d6e8 100644 --- a/tests/z_special_test.py +++ b/tests/z_special_test.py @@ -2,25 +2,25 @@ from subprocess import run import pytest -from gfixture import NC_TO_TEST +from gfixture import NC -from nc_py_api import Nextcloud, NextcloudException +from nc_py_api import NextcloudException # These tests should be run only on GitHub and only in special environment. @pytest.mark.skipif("NC_AUTH_USER" not in environ or "NC_AUTH_PASS" not in environ, reason="Needs login & paasword.") -@pytest.mark.skipif(not isinstance(NC_TO_TEST[:1][0], Nextcloud), reason="Not available for NextcloudApp.") +@pytest.mark.skipif(NC is None, reason="Not available for NextcloudApp.") @pytest.mark.skipif(environ.get("CI", None) is None, reason="run only on GitHub") -def test_password_confirmation(nc): +def test_password_confirmation(): # patch "PasswordConfirmationMiddleware.php" decreasing asking before Password Confirmation from 30 min to 15 secs patch_path = path.join(path.dirname(path.abspath(__file__)), "data/nc_pass_confirm.patch") cwd_path = path.dirname((path.dirname(path.dirname(path.dirname(path.abspath(__file__)))))) print(cwd_path) run(["patch", "-p", "-i", patch_path], cwd=cwd_path, check=True) try: - nc.users.create("test_cover_user_spec", password="ThisIsA54StrongPassword013") + NC.users.create("test_cover_user_spec", password="ThisIsA54StrongPassword013") except NextcloudException: pass - nc.users.delete("test_cover_user_spec") + NC.users.delete("test_cover_user_spec") run(["git", "apply", "-R", patch_path], cwd=cwd_path, check=True)