##// END OF EJS Templates
tests: use pattern matching to mask `ECONNREFUSED` messages...
tests: use pattern matching to mask `ECONNREFUSED` messages The second and third one of these in `test-http-proxy.t` was failing on Windows. The others were found by grep and by failed tests when output was matched and an attempt was made to emit the mask pattern. The first clonebundles failure on Windows emitted: error fetching bundle: [WinError 10061] $ECONNREFUSED$ We should probably stringify that better to get rid of the "[WinError 10061]" part.

File last commit:

r49730:6000f5b2 default
r52835:73a43fe3 default
Show More
test-hgwebdir-paths.py
47 lines | 1.1 KiB | text/x-python | PythonLexer
/ tests / test-hgwebdir-paths.py
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529 import os
Pulkit Goyal
tests: make test-hgwebdir-paths use absolute_import
r28932 from mercurial import (
hg,
ui as uimod,
)
Augie Fackler
formatting: blacken the codebase...
r43346 from mercurial.hgweb import hgwebdir_mod
Pulkit Goyal
tests: make test-hgwebdir-paths use absolute_import
r28932 hgwebdir = hgwebdir_mod.hgwebdir
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529
Augie Fackler
tests: port test-hgwebdir-paths.py to Python 3...
r37896 os.mkdir(b'webdir')
os.chdir(b'webdir')
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529
Augie Fackler
tests: port test-hgwebdir-paths.py to Python 3...
r37896 webdir = os.path.realpath(b'.')
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529
Yuya Nishihara
ui: factor out ui.load() to create a ui without loading configs (API)...
r30559 u = uimod.ui.load()
Augie Fackler
tests: port test-hgwebdir-paths.py to Python 3...
r37896 hg.repository(u, b'a', create=1)
hg.repository(u, b'b', create=1)
os.chdir(b'b')
hg.repository(u, b'd', create=1)
os.chdir(b'..')
hg.repository(u, b'c', create=1)
os.chdir(b'..')
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529
Augie Fackler
formatting: blacken the codebase...
r43346 paths = {
b't/a/': b'%s/a' % webdir,
b'b': b'%s/b' % webdir,
b'coll': b'%s/*' % webdir,
b'rcoll': b'%s/**' % webdir,
}
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529
Augie Fackler
tests: port test-hgwebdir-paths.py to Python 3...
r37896 config = os.path.join(webdir, b'hgwebdir.conf')
configfile = open(config, 'wb')
configfile.write(b'[paths]\n')
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529 for k, v in paths.items():
Augie Fackler
tests: port test-hgwebdir-paths.py to Python 3...
r37896 configfile.write(b'%s = %s\n' % (k, v))
Jeremy Whitlock
hgweb: make hgwebdir handle dict/list paths the same as config paths...
r8529 configfile.close()
confwd = hgwebdir(config)
dictwd = hgwebdir(paths)
assert len(confwd.repos) == len(dictwd.repos), 'different numbers'
assert len(confwd.repos) == 9, 'expected 9 repos, found %d' % len(confwd.repos)
found = dict(confwd.repos)
for key, path in dictwd.repos:
assert key in found, 'repository %s was not found' % key
assert found[key] == path, 'different paths for repo %s' % key