Florian Bruhin
78d7ac311f
Use fonts.monospace properly
2017-07-04 15:08:04 +02:00
Florian Bruhin
d641652a92
More test_config improvements
2017-07-04 15:08:04 +02:00
Florian Bruhin
c214acd899
Remove config from objreg
2017-07-04 15:08:04 +02:00
Florian Bruhin
f8a88ae042
Clean up objreg properly in config tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
54adf3898a
Add test_configfiles.py
2017-07-04 15:08:04 +02:00
Florian Bruhin
1a492e9f4a
Re-add backend checks to new config
2017-07-04 15:08:04 +02:00
Florian Bruhin
215fd2f055
More test_config fixes/tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
009ed3584d
Reorder tests
2017-07-04 15:08:04 +02:00
Florian Bruhin
2b9b54cf6b
Tests and improvements for ConfigContainer
2017-07-04 15:08:03 +02:00
Florian Bruhin
4495e721d8
Tests and fixes for config.Config
2017-07-04 15:08:03 +02:00
Florian Bruhin
07d0ea6a54
Unit tests and improvements for :bind/:unbind
2017-07-04 15:08:03 +02:00
Florian Bruhin
3edebce833
Add tests for :set
2017-07-04 15:08:03 +02:00
Florian Bruhin
31b999ea59
Tests and improvements for KeyConfig
2017-07-04 15:08:03 +02:00
Florian Bruhin
725ffef5f3
Use a real config object in unit tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
a8c7e8ba05
Add first config tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
28670f8e48
Move config.style into config.config and refactor it
2017-07-04 15:08:03 +02:00
Florian Bruhin
81d6406e14
Update test_stylesheet
2017-07-04 15:08:03 +02:00
Florian Bruhin
a5c8a52dd5
Update config_stub for tests
2017-07-04 15:08:03 +02:00
Florian Bruhin
0dc95aceed
Clean up old test_config.py
2017-07-04 15:08:03 +02:00
Florian Bruhin
065f82f485
Fix endless recursion while validating aliases
2017-07-04 15:08:03 +02:00
Florian Bruhin
441b3a4df4
Allow missing fixed_keys for configtypes.Dict
...
We just fill them up with a None value for the value type, so we can e.g. only
specify a subset of modes for bindings and the rest is {}.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9d8b76e497
Simplify _none_value for List/Dict configtypes
...
We don't need to check for fixed_keys/required_keys in get_obj (only get_py),
and we don't need to care about mutability in get_py.
2017-07-04 15:08:03 +02:00
Florian Bruhin
da0a2b8578
Handle {} and [] with none_ok for configtypes.Dict/List
2017-07-04 15:08:03 +02:00
Florian Bruhin
2ba637891a
Add required_keys for configtypes.Dict
2017-07-04 15:08:03 +02:00
Florian Bruhin
7ee222af88
Return [] for none-values for configtypes.List
2017-07-04 15:08:03 +02:00
Florian Bruhin
9cbacf3264
Use {} for none-dicts and fix keybindings
2017-07-04 15:08:03 +02:00
Florian Bruhin
127db2fe42
Be a bit more relaxed about values for Perc
...
We now allow float/int for objects, and strings without a trailing % sign.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9bd438618a
Add a test for DuplicateKeyError
2017-07-04 15:08:03 +02:00
Florian Bruhin
2a40401398
Fix config tests for new Command type
2017-07-04 15:08:03 +02:00
Florian Bruhin
383968d948
Add a Key config type
...
Make sure any key we get from the config is normalized).
2017-07-04 15:08:02 +02:00
Florian Bruhin
bc8176ff21
Remove most legacy config code
2017-07-04 15:08:02 +02:00
Florian Bruhin
f5d2c48bbb
Fix new keyconfig issues
2017-07-04 15:08:02 +02:00
Florian Bruhin
dc74a55b84
Fix remaining configtypes issues
2017-07-04 15:08:02 +02:00
Florian Bruhin
3392ccc58b
test_configtypes fixes
2017-07-04 15:08:02 +02:00
Florian Bruhin
ecba175b16
Test and fix configtypes to_str.
2017-07-04 15:08:02 +02:00
Florian Bruhin
d69c6d0c66
Reorganize how configtypes store their data
...
Now the "object" kind of value (like in YAML) is stored internally, and that's
the canonical value. The methods changed their meaning slightly, see the
docstring in configtypes.py for details.
2017-07-04 15:08:02 +02:00
Florian Bruhin
1cbb4ece4b
Force configtype.Dict keys to be strings
2017-07-04 15:08:02 +02:00
Florian Bruhin
41655e7852
Fix handling of none_ok in List/Dict
...
We now always return None (and '' as string) when the user configured an empty
list or dict.
2017-07-04 15:08:01 +02:00
Florian Bruhin
8ea3d92697
Initial implementation of to_str for configtypes
2017-07-04 15:08:01 +02:00
Florian Bruhin
fede64ba7a
Add test for configdata.is_valid_prefix
2017-07-04 15:08:01 +02:00
Florian Bruhin
18eb133811
configdata: Make sure default values are valid
2017-07-04 15:08:01 +02:00
Florian Bruhin
0857a45b0a
configtypes: parse regex flags properly
2017-07-04 15:08:01 +02:00
Florian Bruhin
001312ca82
Disallow Booleans for configtypes.Int.from_py
2017-07-04 14:42:56 +02:00
Florian Bruhin
4e729bb9ec
Back to using json in test_configtypes
...
It returns one-line data and is YAML compatible
2017-07-04 14:42:56 +02:00
Florian Bruhin
dfee857466
Make utils.yaml_dump return str
2017-07-04 14:42:56 +02:00
Florian Bruhin
05dc94ccc4
Improve configtypes tests
2017-07-04 14:42:56 +02:00
Florian Bruhin
7416164aca
Rename old validate tests
2017-07-04 14:42:56 +02:00
Florian Bruhin
71f2e8c577
None validation fixups for test_configtypes
2017-07-04 14:42:56 +02:00
Florian Bruhin
61ba92ae18
configtypes: Separate str/py basic validation
...
This also ensures the behavior for none_ok is consistent.
2017-07-04 14:42:56 +02:00
Florian Bruhin
cdbd64a30d
Move test_configtypes_hypothesis to test_configtypes
2017-07-04 14:42:56 +02:00