Adds some testing

This commit is contained in:
Samuel Henrique Oliveira da Silva 2017-11-19 09:40:17 -02:00
parent 66fd636845
commit 14ed7eb669

16
tests/test_wallpaper.py Normal file
View file

@ -0,0 +1,16 @@
from pokemonterminal.wallpaper import _get_adapter_classes
import os.path as __p
import inspect as __inspct
def test_wallpaper_adapter_classes():
all_adapter = _get_adapter_classes()
files = {__inspct.getfile(x) for x in all_adapter}
print('all adapter classes:\n', files)
assert len(all_adapter) >= len(files), \
"Some of the files in the adapter module don't define an adapter"
module_name = {x.__name__: __p.splitext(__p.basename(
__inspct.getfile(x)))[0] for x in all_adapter}
print("'class: module' map\n", module_name)
assert all(y.lower() in x.lower() for x, y in module_name.items()), \
"Some of the adapters are defined in unrelated named modules"