##// END OF EJS Templates
wireprotov2: define and implement "manifestdata" command...
wireprotov2: define and implement "manifestdata" command The added command can be used for obtaining manifest data. Given a manifest path and set of manifest nodes, data about manifests can be retrieved. Unlike changeset data, we wish to emit deltas to describe manifest revisions. So the command uses the relatively new API for building delta requests and emitting them. The code calls into deltaparent(), which I'm not very keen of. There's still work to be done in delta generation land so implementation details of storage (e.g. exactly one delta is stored/available) don't creep into higher levels. But we can worry about this later (there is already a TODO on imanifestorage tracking this). On the subject of parent deltas, the server assumes parent revisions exist on the receiving end. This is obviously wrong for shallow clone. I've added TODOs to add a mechanism to the command to allow clients to specify desired behavior. This shouldn't be too difficult to implement. Another big change is that the client must explicitly request manifest nodes to retrieve. This is a major departure from "getbundle," where the server derives relevant manifests as it iterates changesets and sends them automatically. As implemented, the client must transmit each requested node to the server. At 20 bytes per node, we're looking at 2 MB per 100,000 nodes. Plus wire encoding overhead. This isn't ideal for clients with limited upload bandwidth. I plan to address this in the future by allowing alternate mechanisms for defining the revisions to retrieve. One idea is to define a range of changeset revisions whose manifest revisions to retrieve (similar to how "changesetdata" works). We almost certainly want an API to look up an individual manifest by node. And that's where I've chosen to start with the implementation. Again, a theme of this early exchangev2 work is I want to start by building primitives for accessing raw repository data first and see how far we can get with those before we need more complexity. Differential Revision: https://phab.mercurial-scm.org/D4488

File last commit:

r37912:e0598133 default
r39673:c7a7c7e8 default
Show More
test-wsgirequest.py
422 lines | 17.7 KiB | text/x-python | PythonLexer
/ tests / test-wsgirequest.py
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 from __future__ import absolute_import, print_function
import unittest
from mercurial.hgweb import (
request as requestmod,
)
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 from mercurial import (
error,
)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
DEFAULT_ENV = {
r'REQUEST_METHOD': r'GET',
r'SERVER_NAME': r'testserver',
r'SERVER_PORT': r'80',
r'SERVER_PROTOCOL': r'http',
r'wsgi.version': (1, 0),
r'wsgi.url_scheme': r'http',
r'wsgi.input': None,
r'wsgi.errors': None,
r'wsgi.multithread': False,
r'wsgi.multiprocess': True,
r'wsgi.run_once': False,
}
Gregory Szorc
hgweb: remove wsgirequest (API)...
r36928 def parse(env, reponame=None, altbaseurl=None, extra=None):
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 env = dict(env)
env.update(extra or {})
Gregory Szorc
hgweb: remove wsgirequest (API)...
r36928 return requestmod.parserequestfromenv(env, reponame=reponame,
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 altbaseurl=altbaseurl)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
class ParseRequestTests(unittest.TestCase):
def testdefault(self):
r = parse(DEFAULT_ENV)
self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.method, b'GET')
self.assertIsNone(r.remoteuser)
self.assertIsNone(r.remotehost)
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
Gregory Szorc
hgweb: change how dispatch path is reported...
r36914 self.assertIsNone(r.dispatchpath)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 self.assertIsNone(r.reponame)
self.assertEqual(r.querystring, b'')
self.assertEqual(len(r.qsparams), 0)
self.assertEqual(len(r.headers), 0)
def testcustomport(self):
r = parse(DEFAULT_ENV, extra={
r'SERVER_PORT': r'8000',
})
self.assertEqual(r.url, b'http://testserver:8000')
self.assertEqual(r.baseurl, b'http://testserver:8000')
self.assertEqual(r.advertisedurl, b'http://testserver:8000')
self.assertEqual(r.advertisedbaseurl, b'http://testserver:8000')
r = parse(DEFAULT_ENV, extra={
r'SERVER_PORT': r'4000',
r'wsgi.url_scheme': r'https',
})
self.assertEqual(r.url, b'https://testserver:4000')
self.assertEqual(r.baseurl, b'https://testserver:4000')
self.assertEqual(r.advertisedurl, b'https://testserver:4000')
self.assertEqual(r.advertisedbaseurl, b'https://testserver:4000')
def testhttphost(self):
r = parse(DEFAULT_ENV, extra={
r'HTTP_HOST': r'altserver',
})
self.assertEqual(r.url, b'http://altserver')
self.assertEqual(r.baseurl, b'http://altserver')
self.assertEqual(r.advertisedurl, b'http://testserver')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
def testscriptname(self):
r = parse(DEFAULT_ENV, extra={
r'SCRIPT_NAME': r'',
})
self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
Gregory Szorc
hgweb: change how dispatch path is reported...
r36914 self.assertIsNone(r.dispatchpath)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
r = parse(DEFAULT_ENV, extra={
r'SCRIPT_NAME': r'/script',
})
self.assertEqual(r.url, b'http://testserver/script')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/script')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/script')
self.assertEqual(r.dispatchparts, [])
Gregory Szorc
hgweb: change how dispatch path is reported...
r36914 self.assertIsNone(r.dispatchpath)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
r = parse(DEFAULT_ENV, extra={
r'SCRIPT_NAME': r'/multiple words',
})
self.assertEqual(r.url, b'http://testserver/multiple%20words')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/multiple%20words')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/multiple words')
self.assertEqual(r.dispatchparts, [])
Gregory Szorc
hgweb: change how dispatch path is reported...
r36914 self.assertIsNone(r.dispatchpath)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
def testpathinfo(self):
r = parse(DEFAULT_ENV, extra={
r'PATH_INFO': r'',
})
self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
self.assertEqual(r.dispatchpath, b'')
r = parse(DEFAULT_ENV, extra={
r'PATH_INFO': r'/pathinfo',
})
self.assertEqual(r.url, b'http://testserver/pathinfo')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/pathinfo')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [b'pathinfo'])
self.assertEqual(r.dispatchpath, b'pathinfo')
r = parse(DEFAULT_ENV, extra={
r'PATH_INFO': r'/one/two/',
})
self.assertEqual(r.url, b'http://testserver/one/two/')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/one/two/')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [b'one', b'two'])
self.assertEqual(r.dispatchpath, b'one/two')
def testscriptandpathinfo(self):
r = parse(DEFAULT_ENV, extra={
r'SCRIPT_NAME': r'/script',
r'PATH_INFO': r'/pathinfo',
})
self.assertEqual(r.url, b'http://testserver/script/pathinfo')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/script/pathinfo')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/script')
self.assertEqual(r.dispatchparts, [b'pathinfo'])
self.assertEqual(r.dispatchpath, b'pathinfo')
r = parse(DEFAULT_ENV, extra={
r'SCRIPT_NAME': r'/script1/script2',
r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url,
b'http://testserver/script1/script2/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://testserver/script1/script2/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/script1/script2')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
r = parse(DEFAULT_ENV, extra={
r'HTTP_HOST': r'hostserver',
r'SCRIPT_NAME': r'/script',
r'PATH_INFO': r'/pathinfo',
})
self.assertEqual(r.url, b'http://hostserver/script/pathinfo')
self.assertEqual(r.baseurl, b'http://hostserver')
self.assertEqual(r.advertisedurl, b'http://testserver/script/pathinfo')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/script')
self.assertEqual(r.dispatchparts, [b'pathinfo'])
self.assertEqual(r.dispatchpath, b'pathinfo')
Augie Fackler
cleanup: polyfill assertRaisesRegex so we can avoid assertRaisesRegexp...
r37733 if not getattr(unittest.TestCase, 'assertRaisesRegex', False):
# Python 3.7 deprecates the regex*p* version, but 2.7 lacks
# the regex version.
assertRaisesRegex = (# camelcase-required
unittest.TestCase.assertRaisesRegexp)
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 def testreponame(self):
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 """repository path components get stripped from URL."""
Augie Fackler
cleanup: polyfill assertRaisesRegex so we can avoid assertRaisesRegexp...
r37733 with self.assertRaisesRegex(error.ProgrammingError,
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 'reponame requires PATH_INFO'):
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 parse(DEFAULT_ENV, reponame=b'repo')
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
Augie Fackler
cleanup: polyfill assertRaisesRegex so we can avoid assertRaisesRegexp...
r37733 with self.assertRaisesRegex(error.ProgrammingError,
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 'PATH_INFO does not begin with repo '
'name'):
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 parse(DEFAULT_ENV, reponame=b'repo', extra={
r'PATH_INFO': r'/pathinfo',
})
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912
Augie Fackler
cleanup: polyfill assertRaisesRegex so we can avoid assertRaisesRegexp...
r37733 with self.assertRaisesRegex(error.ProgrammingError,
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 'reponame prefix of PATH_INFO'):
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 parse(DEFAULT_ENV, reponame=b'repo', extra={
r'PATH_INFO': r'/repoextra/path',
})
r = parse(DEFAULT_ENV, reponame=b'repo', extra={
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 r'PATH_INFO': r'/repo/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/repo/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://testserver/repo/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/repo')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertEqual(r.reponame, b'repo')
Gregory Szorc
hgweb: refactor repository name URL parsing...
r36913 r = parse(DEFAULT_ENV, reponame=b'prefix/repo', extra={
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 r'PATH_INFO': r'/prefix/repo/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/prefix/repo/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://testserver/prefix/repo/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://testserver')
self.assertEqual(r.apppath, b'/prefix/repo')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertEqual(r.reponame, b'prefix/repo')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 def testaltbaseurl(self):
# Simple hostname remap.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916
self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# With a custom port.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver:8000')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver:8000')
self.assertEqual(r.advertisedbaseurl, b'http://altserver:8000')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# With a changed protocol.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'https://altserver')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'https://altserver')
self.assertEqual(r.advertisedbaseurl, b'https://altserver')
# URL scheme is defined as the actual scheme, not advertised.
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# Need to specify explicit port number for proper https:// alt URLs.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'https://altserver:443')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'https://altserver')
self.assertEqual(r.advertisedbaseurl, b'https://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# With only PATH_INFO defined.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver', extra={
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertIsNone(r.reponame)
# Path on alt URL.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver/altpath')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver/altpath')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'/altpath')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# With a trailing slash.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver/altpath/')
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 self.assertEqual(r.url, b'http://testserver')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver/altpath/')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'/altpath/')
self.assertEqual(r.dispatchparts, [])
self.assertIsNone(r.dispatchpath)
self.assertIsNone(r.reponame)
# PATH_INFO + path on alt URL.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver/altpath', extra={
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://altserver/altpath/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'/altpath')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertIsNone(r.reponame)
# PATH_INFO + path on alt URL with trailing slash.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver/altpath/', extra={
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://altserver/altpath//path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'/altpath/')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertIsNone(r.reponame)
# Local SCRIPT_NAME is ignored.
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver', extra={
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 r'SCRIPT_NAME': r'/script',
r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/script/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl, b'http://altserver/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertIsNone(r.reponame)
# Use remote's path for script name, app path
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 r = parse(DEFAULT_ENV, altbaseurl=b'http://altserver/altroot', extra={
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 r'SCRIPT_NAME': r'/script',
r'PATH_INFO': r'/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/script/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://altserver/altroot/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.urlscheme, b'http')
self.assertEqual(r.apppath, b'/altroot')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertIsNone(r.reponame)
# reponame is factored in properly.
r = parse(DEFAULT_ENV, reponame=b'repo',
Augie Fackler
tests: migrate test-wsgirequest.py to Python 3...
r37912 altbaseurl=b'http://altserver/altroot',
Gregory Szorc
hgweb: support constructing URLs from an alternate base URL...
r36916 extra={
r'SCRIPT_NAME': r'/script',
r'PATH_INFO': r'/repo/path1/path2',
})
self.assertEqual(r.url, b'http://testserver/script/repo/path1/path2')
self.assertEqual(r.baseurl, b'http://testserver')
self.assertEqual(r.advertisedurl,
b'http://altserver/altroot/repo/path1/path2')
self.assertEqual(r.advertisedbaseurl, b'http://altserver')
self.assertEqual(r.apppath, b'/altroot/repo')
self.assertEqual(r.dispatchparts, [b'path1', b'path2'])
self.assertEqual(r.dispatchpath, b'path1/path2')
self.assertEqual(r.reponame, b'repo')
Gregory Szorc
tests: add test coverage for parsing WSGI requests...
r36912 if __name__ == '__main__':
import silenttestrunner
silenttestrunner.main(__name__)