##// END OF EJS Templates
tests: fixed some flacky tests on docker.
milka -
r4654:930a1cf8 default
parent child Browse files
Show More
@@ -19,6 +19,8 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import json
21 import json
22 import os
23
22 import mock
24 import mock
23 import pytest
25 import pytest
24
26
@@ -107,6 +109,8 b' class TestGitServer(object):'
107 def test_run_returns_executes_command(self, git_server):
109 def test_run_returns_executes_command(self, git_server):
108 server = git_server.create()
110 server = git_server.create()
109 from rhodecode.apps.ssh_support.lib.backends.git import GitTunnelWrapper
111 from rhodecode.apps.ssh_support.lib.backends.git import GitTunnelWrapper
112
113 os.environ['SSH_CLIENT'] = '127.0.0.1'
110 with mock.patch.object(GitTunnelWrapper, 'create_hooks_env') as _patch:
114 with mock.patch.object(GitTunnelWrapper, 'create_hooks_env') as _patch:
111 _patch.return_value = 0
115 _patch.return_value = 0
112 with mock.patch.object(GitTunnelWrapper, 'command', return_value='date'):
116 with mock.patch.object(GitTunnelWrapper, 'command', return_value='date'):
@@ -108,6 +108,7 b' class TestMercurialServer(object):'
108 def test_run_returns_executes_command(self, hg_server):
108 def test_run_returns_executes_command(self, hg_server):
109 server = hg_server.create()
109 server = hg_server.create()
110 from rhodecode.apps.ssh_support.lib.backends.hg import MercurialTunnelWrapper
110 from rhodecode.apps.ssh_support.lib.backends.hg import MercurialTunnelWrapper
111 os.environ['SSH_CLIENT'] = '127.0.0.1'
111 with mock.patch.object(MercurialTunnelWrapper, 'create_hooks_env') as _patch:
112 with mock.patch.object(MercurialTunnelWrapper, 'create_hooks_env') as _patch:
112 _patch.return_value = 0
113 _patch.return_value = 0
113 with mock.patch.object(MercurialTunnelWrapper, 'command', return_value='date'):
114 with mock.patch.object(MercurialTunnelWrapper, 'command', return_value='date'):
@@ -17,7 +17,7 b''
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20 import os
21 import mock
21 import mock
22 import pytest
22 import pytest
23
23
@@ -174,6 +174,7 b' class TestSubversionServer(object):'
174 def test_run_returns_executes_command(self, svn_server):
174 def test_run_returns_executes_command(self, svn_server):
175 server = svn_server.create()
175 server = svn_server.create()
176 from rhodecode.apps.ssh_support.lib.backends.svn import SubversionTunnelWrapper
176 from rhodecode.apps.ssh_support.lib.backends.svn import SubversionTunnelWrapper
177 os.environ['SSH_CLIENT'] = '127.0.0.1'
177 with mock.patch.object(
178 with mock.patch.object(
178 SubversionTunnelWrapper, 'get_first_client_response',
179 SubversionTunnelWrapper, 'get_first_client_response',
179 return_value={'url': 'http://server/test-svn'}):
180 return_value={'url': 'http://server/test-svn'}):
General Comments 0
You need to be logged in to leave comments. Login now