Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Jul 29, 2023
1 parent b2cbe76 commit 15934b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/z_special_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 15934b7

Please sign in to comment.