diff --git a/rhodecode/apps/ssh_support/tests/test_server_git.py b/rhodecode/apps/ssh_support/tests/test_server_git.py --- a/rhodecode/apps/ssh_support/tests/test_server_git.py +++ b/rhodecode/apps/ssh_support/tests/test_server_git.py @@ -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'): diff --git a/rhodecode/apps/ssh_support/tests/test_server_hg.py b/rhodecode/apps/ssh_support/tests/test_server_hg.py --- a/rhodecode/apps/ssh_support/tests/test_server_hg.py +++ b/rhodecode/apps/ssh_support/tests/test_server_hg.py @@ -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'): diff --git a/rhodecode/apps/ssh_support/tests/test_server_svn.py b/rhodecode/apps/ssh_support/tests/test_server_svn.py --- a/rhodecode/apps/ssh_support/tests/test_server_svn.py +++ b/rhodecode/apps/ssh_support/tests/test_server_svn.py @@ -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'}):