aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_constants.py
diff options
context:
space:
mode:
authorGravatar Akarys42 <[email protected]>2019-09-23 16:15:49 +0200
committerGravatar Akarys42 <[email protected]>2019-09-23 16:15:49 +0200
commit052fc4e36be6b0027ebbace530dbd9814660dc66 (patch)
tree250036c9d5162c6ee62d1a7bd6c999a03a2caad5 /tests/test_constants.py
parentChange log.error to log.exception (diff)
parentMake DEFCON days subcommand enable DEFCON (#405) (diff)
Merge branch 'master' of https://github.com/python-discord/bot into python-discord-master
Diffstat (limited to 'tests/test_constants.py')
-rw-r--r--tests/test_constants.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_constants.py b/tests/test_constants.py
new file mode 100644
index 000000000..e4a29d994
--- /dev/null
+++ b/tests/test_constants.py
@@ -0,0 +1,23 @@
+import inspect
+
+import pytest
+
+from bot import constants
+
+
+ 'section',
+ (
+ cls
+ for (name, cls) in inspect.getmembers(constants)
+ if hasattr(cls, 'section') and isinstance(cls, type)
+ )
+)
+def test_section_configuration_matches_typespec(section):
+ for (name, annotation) in section.__annotations__.items():
+ value = getattr(section, name)
+
+ if getattr(annotation, '_name', None) in ('Dict', 'List'):
+ pytest.skip("Cannot validate containers yet")
+
+ assert isinstance(value, annotation)