fix(tests): added ability for test to get an up-to-date version mercurial.

This commit is contained in:
Serhii Ilin 2024-12-05 16:33:07 +02:00
parent a1989bf442
commit 279e84da82

View file

@ -21,6 +21,7 @@ Test suite for making push/pull operations, on specially modified INI files
""" """
import pytest import pytest
from importlib.metadata import version
from rhodecode.model.meta import Session from rhodecode.model.meta import Session
from rhodecode.model.settings import SettingsModel from rhodecode.model.settings import SettingsModel
@ -65,7 +66,8 @@ class TestVCSOperationsOnUsingBadClient(object):
# push fails repo is locked by other user ! # push fails repo is locked by other user !
push_url = rcstack.repo_clone_url(HG_REPO) push_url = rcstack.repo_clone_url(HG_REPO)
stdout, stderr = _add_files_and_push("hg", tmpdir.strpath, clone_url=push_url) stdout, stderr = _add_files_and_push("hg", tmpdir.strpath, clone_url=push_url)
msg = "Your hg client (version=mercurial/proto-1.0 (Mercurial 6.7.4)) is forbidden by security rules" current_version = version('mercurial')
msg = f"Your hg client (version=mercurial/proto-1.0 (Mercurial {current_version})) is forbidden by security rules"
assert msg in stderr assert msg in stderr
def test_push_with_bad_client_repo_by_other_user_git(self, rcstack, tmpdir): def test_push_with_bad_client_repo_by_other_user_git(self, rcstack, tmpdir):