mirror of
https://github.com/LazoCoder/Pokemon-Terminal
synced 2024-11-26 13:50:18 +00:00
Adds some testing
This commit is contained in:
parent
66fd636845
commit
14ed7eb669
1 changed files with 16 additions and 0 deletions
16
tests/test_wallpaper.py
Normal file
16
tests/test_wallpaper.py
Normal 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"
|
Loading…
Reference in a new issue