tests: fixed some flacky tests on docker.

This commit is contained in:
Milka Kuzminski 2021-03-17 08:15:29 +01:00
parent 2cc353de2c
commit 6a44d04b91
3 changed files with 7 additions and 1 deletions

View file

@ -19,6 +19,8 @@
# and proprietary license terms, please see https://rhodecode.com/licenses/
import json
import os
import mock
import pytest
@ -107,6 +109,8 @@ class TestGitServer(object):
def test_run_returns_executes_command(self, git_server):
server = git_server.create()
from rhodecode.apps.ssh_support.lib.backends.git import GitTunnelWrapper
os.environ['SSH_CLIENT'] = '127.0.0.1'
with mock.patch.object(GitTunnelWrapper, 'create_hooks_env') as _patch:
_patch.return_value = 0
with mock.patch.object(GitTunnelWrapper, 'command', return_value='date'):

View file

@ -108,6 +108,7 @@ class TestMercurialServer(object):
def test_run_returns_executes_command(self, hg_server):
server = hg_server.create()
from rhodecode.apps.ssh_support.lib.backends.hg import MercurialTunnelWrapper
os.environ['SSH_CLIENT'] = '127.0.0.1'
with mock.patch.object(MercurialTunnelWrapper, 'create_hooks_env') as _patch:
_patch.return_value = 0
with mock.patch.object(MercurialTunnelWrapper, 'command', return_value='date'):

View file

@ -17,7 +17,7 @@
# This program is dual-licensed. If you wish to learn more about the
# RhodeCode Enterprise Edition, including its added features, Support services,
# and proprietary license terms, please see https://rhodecode.com/licenses/
import os
import mock
import pytest
@ -174,6 +174,7 @@ class TestSubversionServer(object):
def test_run_returns_executes_command(self, svn_server):
server = svn_server.create()
from rhodecode.apps.ssh_support.lib.backends.svn import SubversionTunnelWrapper
os.environ['SSH_CLIENT'] = '127.0.0.1'
with mock.patch.object(
SubversionTunnelWrapper, 'get_first_client_response',
return_value={'url': 'http://server/test-svn'}):