##// END OF EJS Templates
vcs-http: explicitly pass in vcs-type into vcsserver.
marcink -
r1126:e9e0b5e3 default
parent child Browse files
Show More
@@ -109,11 +109,11 b' def connect_http(server_and_port):'
109 109 session_factory = client_http.ThreadlocalSessionFactory()
110 110
111 111 connection.Git = client_http.RepoMaker(
112 server_and_port, '/git', session_factory)
112 server_and_port, '/git', 'git', session_factory)
113 113 connection.Hg = client_http.RepoMaker(
114 server_and_port, '/hg', session_factory)
114 server_and_port, '/hg', 'hg', session_factory)
115 115 connection.Svn = client_http.RepoMaker(
116 server_and_port, '/svn', session_factory)
116 server_and_port, '/svn', 'svn', session_factory)
117 117 connection.Service = client_http.ServiceConnection(
118 118 server_and_port, '/_service', session_factory)
119 119
@@ -56,10 +56,11 b' EXCEPTIONS_MAP = {'
56 56
57 57 class RepoMaker(object):
58 58
59 def __init__(self, server_and_port, backend_endpoint, session_factory):
59 def __init__(self, server_and_port, backend_endpoint, backend_type, session_factory):
60 60 self.url = urlparse.urljoin(
61 61 'http://%s' % server_and_port, backend_endpoint)
62 62 self._session_factory = session_factory
63 self.backend_type = backend_type
63 64
64 65 def __call__(self, path, config, with_wire=None):
65 66 log.debug('RepoMaker call on %s', path)
@@ -77,6 +78,7 b' class RepoMaker(object):'
77 78 payload = {
78 79 'id': str(uuid.uuid4()),
79 80 'method': name,
81 'backend': self.backend_type,
80 82 'params': {'args': args, 'kwargs': kwargs}
81 83 }
82 84 return _remote_call(
@@ -70,7 +70,7 b' def stub_session_factory(stub_session):'
70 70
71 71 def test_repo_maker_uses_session_for_classmethods(stub_session_factory):
72 72 repo_maker = client_http.RepoMaker(
73 'server_and_port', 'endpoint', stub_session_factory)
73 'server_and_port', 'endpoint', 'test_dummy_scm', stub_session_factory)
74 74 repo_maker.example_call()
75 75 stub_session_factory().post.assert_called_with(
76 76 'http://server_and_port/endpoint', data=mock.ANY)
@@ -79,7 +79,7 b' def test_repo_maker_uses_session_for_cla'
79 79 def test_repo_maker_uses_session_for_instance_methods(
80 80 stub_session_factory, config):
81 81 repo_maker = client_http.RepoMaker(
82 'server_and_port', 'endpoint', stub_session_factory)
82 'server_and_port', 'endpoint', 'test_dummy_scm', stub_session_factory)
83 83 repo = repo_maker('stub_path', config)
84 84 repo.example_call()
85 85 stub_session_factory().post.assert_called_with(
General Comments 0
You need to be logged in to leave comments. Login now