tests/test-doctest.py
author Patrick Mezard <pmezard@gmail.com>
Mon, 01 Aug 2011 23:58:50 +0200
branchstable
changeset 15005 4a43e23b8c55
parent 14171 fa2b596db182
child 14901 a773119f30ba
permissions -rw-r--r--
hgweb: do not ignore [auth] if url has a username (issue2822) The [auth] section was ignored when handling URLs like: http://user@example.com/foo Instead, we look in [auth] for an entry matching the URL and supplied user name. Entries without username can match URL with a username. Prefix length ties are resolved in favor of entries matching the username. With: foo.prefix = http://example.org foo.username = user foo.password = password bar.prefix = http://example.org/bar and the input URL: http://user@example.org/bar the 'bar' entry will be selected because of prefix length, therefore prompting for a password. This behaviour ensure that entries selection is consistent when looking for credentials or for certificates, and that certificates can be picked even if their entries do no define usernames while the URL does. Additionally, entries without a username matched against a username are returned as if they did have requested username set to avoid prompting again for a username if the password is not set. v2: reparse the URL in readauthforuri() to handle HTTP and HTTPS similarly. v3: allow unset usernames to match URL usernames to pick certificates. Resolve prefix length ties in favor of entries with usernames.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7041
b856071435f7 tests: fix readline escape characters in output for test-doctest.py
Mads Kiilerich <mads@kiilerich.com>
parents: 5525
diff changeset
     1
# this is hack to make sure no escape characters are inserted into the output
10413
e433002acb05 fix up a bunch of check-code warnings
Matt Mackall <mpm@selenic.com>
parents: 7185
diff changeset
     2
import os
7078
967adcf5910d test-doctest: remove TERM env variable only if it's there
Patrick Mezard <pmezard@gmail.com>
parents: 7041
diff changeset
     3
if 'TERM' in os.environ:
7184
380fda3eed13 clean up trailing spaces
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7078
diff changeset
     4
    del os.environ['TERM']
3232
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     5
import doctest
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     6
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     7
import mercurial.changelog
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     8
doctest.testmod(mercurial.changelog)
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     9
11335
3201ff1459dd dagparser: parses and formats DAGs as concise text
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10413
diff changeset
    10
import mercurial.dagparser
11337
0f3c8a47960e debugbuilddag: build a changelog dag from a concise description
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 11335
diff changeset
    11
doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)
11335
3201ff1459dd dagparser: parses and formats DAGs as concise text
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10413
diff changeset
    12
12165
b7fbf24c8a93 match: add narrowmatcher class
Martin Geisler <mg@lazybytes.net>
parents: 11337
diff changeset
    13
import mercurial.match
b7fbf24c8a93 match: add narrowmatcher class
Martin Geisler <mg@lazybytes.net>
parents: 11337
diff changeset
    14
doctest.testmod(mercurial.match)
b7fbf24c8a93 match: add narrowmatcher class
Martin Geisler <mg@lazybytes.net>
parents: 11337
diff changeset
    15
13949
ba43aa1e173c store: add some doctests
Adrian Buehlmann <adrian@cadifra.com>
parents: 13402
diff changeset
    16
import mercurial.store
ba43aa1e173c store: add some doctests
Adrian Buehlmann <adrian@cadifra.com>
parents: 13402
diff changeset
    17
doctest.testmod(mercurial.store)
ba43aa1e173c store: add some doctests
Adrian Buehlmann <adrian@cadifra.com>
parents: 13402
diff changeset
    18
14171
fa2b596db182 ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents: 13949
diff changeset
    19
import mercurial.ui
fa2b596db182 ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents: 13949
diff changeset
    20
doctest.testmod(mercurial.ui)
fa2b596db182 ui: add configint function and tests
Sune Foldager <cryo@cyanite.org>
parents: 13949
diff changeset
    21
12594
bb324910e40a test-doctest: test the modules that contains doctests
Mads Kiilerich <mads@kiilerich.com>
parents: 11337
diff changeset
    22
import mercurial.url
bb324910e40a test-doctest: test the modules that contains doctests
Mads Kiilerich <mads@kiilerich.com>
parents: 11337
diff changeset
    23
doctest.testmod(mercurial.url)
bb324910e40a test-doctest: test the modules that contains doctests
Mads Kiilerich <mads@kiilerich.com>
parents: 11337
diff changeset
    24
13212
5d0a30fad7de date: fix matching of underspecified date ranges
Matt Mackall <mpm@selenic.com>
parents: 12595
diff changeset
    25
import mercurial.util
5d0a30fad7de date: fix matching of underspecified date ranges
Matt Mackall <mpm@selenic.com>
parents: 12595
diff changeset
    26
doctest.testmod(mercurial.util)
5d0a30fad7de date: fix matching of underspecified date ranges
Matt Mackall <mpm@selenic.com>
parents: 12595
diff changeset
    27
13046
7cc4263e07a9 encoding: add localstr class to track UTF-8 version of transcoded strings
Matt Mackall <mpm@selenic.com>
parents: 12595
diff changeset
    28
import mercurial.encoding
7cc4263e07a9 encoding: add localstr class to track UTF-8 version of transcoded strings
Matt Mackall <mpm@selenic.com>
parents: 12595
diff changeset
    29
doctest.testmod(mercurial.encoding)
12594
bb324910e40a test-doctest: test the modules that contains doctests
Mads Kiilerich <mads@kiilerich.com>
parents: 11337
diff changeset
    30
13402
f947d9a4c45c hgweb: doctest of url creation from wildcard expansion
Mads Kiilerich <mads@kiilerich.com>
parents: 13213
diff changeset
    31
import mercurial.hgweb.hgwebdir_mod
f947d9a4c45c hgweb: doctest of url creation from wildcard expansion
Mads Kiilerich <mads@kiilerich.com>
parents: 13213
diff changeset
    32
doctest.testmod(mercurial.hgweb.hgwebdir_mod)
f947d9a4c45c hgweb: doctest of url creation from wildcard expansion
Mads Kiilerich <mads@kiilerich.com>
parents: 13213
diff changeset
    33
7097
d4218edd55bd convert: fix builtin cvsps under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 7078
diff changeset
    34
import hgext.convert.cvsps
d4218edd55bd convert: fix builtin cvsps under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 7078
diff changeset
    35
doctest.testmod(hgext.convert.cvsps)