Pokemon-Terminal/tests/test_wallpaper.py
Samuel Henrique Oliveira da Silva 14ed7eb669 Adds some testing
2017-11-19 09:40:17 -02:00

16 lines
711 B
Python

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"