Commit Graph

14 Commits

Author SHA1 Message Date
Boris Feld
38f9c73dbd configitems: adds a developer warning when accessing undeclared configuration
Now that all known options are declared, we setup a warning to make sure it will
stay this way.

We disable the warning in two tests checking other behavior with random options.
2017-10-16 17:41:27 +02:00
Boris Feld
e12d51e5f8 ui: fix ui.configdate for invalid dates
d46a7814be5f introduced util._parsedate with the aim to be used in
ui.configdate but ui.configdate was using util.parsedate instead. It have the
impact of raising an AbortError in case of an invalid date instead of a
ConfigError exception. Fix ui.configdate to use the right function and add a
test for invalid dates.

Thanks to Yuya for the catch!
2017-05-23 15:44:50 +02:00
Yuya Nishihara
1d44bd2bbb ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.

ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
2016-10-22 14:35:10 +09:00
Yuya Nishihara
ac80a98b68 tests: alias ui as uimod in test-ui-config 2016-04-03 19:56:59 +09:00
Pulkit Goyal
45549ce716 py3: make test-ui-config use print_function 2016-03-29 16:38:27 +05:30
Pulkit Goyal
71fccc06f3 py3: make test-ui-config use absolute_import 2016-03-29 16:33:09 +05:30
Gregory Szorc
5380dea2a7 global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".

This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.

This patch was produced by running `2to3 -f except -w -n .`.
2015-06-23 22:20:08 -07:00
Sune Foldager
73c8696ab4 ui: add configint function and tests 2011-05-03 22:28:08 +02:00
Dan Villiom Podlaski Christiansen
f385faac7a *: kill all unnecessary shebangs. 2010-10-26 12:18:39 +02:00
Thomas Arendsen Hein
56a5e9e864 ui: handle leading newlines/spaces/commas in configlist
Thanks to Greg Ward for spotting the problem introduced in cc0423a3b3fe
and for supplying the test case.
2010-06-08 21:09:41 +02:00
Henrik Stuart
1c5ca1f5d8 ui: support quotes in configlist (issue2147)
Several places that use ui.configlist, predominantly in authentication
scenarios need to interface with systems that can contain spaces in usernames
(e.g. when client certificates are usernames, or Windows usernames).

This changeset introduces a parser that supports quoting of strings, and
escape quotation marks that get decoded into a single quotation mark that
adopts the usual behavior one would expect from quoting strings. The Python
library shlex module is not used, on purpose, as that raises if it cannot
match quotation marks in the given input.
2010-04-25 17:38:41 +02:00
Martin Geisler
58e8fb6277 removed unused imports 2009-05-30 23:20:30 +02:00
Martin Geisler
aedc0ac57f tests: removed unnecessary execute bit on Python tests 2009-05-17 01:42:21 +02:00
Martin Geisler
a645da9ed1 tests: renamed Python tests to .py 2009-05-17 01:39:31 +02:00