# HG changeset patch # User Martin Bornhold # Date 2016-09-26 13:43:55 # Node ID 8728085221e18a7d0fa628807dbee171f2b31115 # Parent 2956cade26d0791cdb7b38edb3ac3ae6e70dc258 tests: Adapt tests to recent changes in vcs lib. diff --git a/rhodecode/tests/lib/middleware/utils/test_scm_app_http.py b/rhodecode/tests/lib/middleware/utils/test_scm_app_http.py --- a/rhodecode/tests/lib/middleware/utils/test_scm_app_http.py +++ b/rhodecode/tests/lib/middleware/utils/test_scm_app_http.py @@ -24,6 +24,7 @@ import pytest import webtest from rhodecode.lib.middleware.utils import scm_app_http, scm_app +from rhodecode.lib.middleware.simplegit import SimpleGit from rhodecode.lib.vcs.conf import settings @@ -111,7 +112,7 @@ def vcs_pyro4_app(vcsserver_pyro_echo_ap with mock.patch('rhodecode.lib.middleware.utils.scm_app.GIT_REMOTE_WSGI', GIT_REMOTE_WSGI): pyro4_app = scm_app.create_git_wsgi_app( - 'stub_path', 'stub_name', stub_config) + 'stub_path', 'stub_name', stub_config, SimpleGit.SCM) app = webtest.TestApp(pyro4_app) return app diff --git a/rhodecode/tests/lib/middleware/utils/test_wsgi_app_caller_client.py b/rhodecode/tests/lib/middleware/utils/test_wsgi_app_caller_client.py --- a/rhodecode/tests/lib/middleware/utils/test_wsgi_app_caller_client.py +++ b/rhodecode/tests/lib/middleware/utils/test_wsgi_app_caller_client.py @@ -86,13 +86,17 @@ def test_remote_app_caller(): return (['content'], '200 OK', [('Content-Type', 'text/plain')]) wrapper_app = wsgi_app_caller_client.RemoteAppCaller( - RemoteAppCallerMock(), 'a1', 'a2', arg3='a3', arg4='a4') + RemoteAppCallerMock(), 'dummy-backend', + 'a1', 'a2', arg3='a3', arg4='a4') test_app = webtest.TestApp(wrapper_app) response = test_app.get('/path') assert response.status == '200 OK' - assert response.headers.items() == [ - ('Content-Type', 'text/plain'), ('Content-Length', '7')] + assert sorted(response.headers.items()) == sorted([ + ('X-RhodeCode-Backend', 'dummy-backend'), + ('Content-Type', 'text/plain'), + ('Content-Length', '7'), + ]) assert response.body == 'content'