[tests] add somewhat experimental import-time tests
add auto-generated tests that check that a given module can be imported, if all prerequisites are followed. see #641
This commit is contained in:
parent
9be1331e1b
commit
548ccc5e94
94 changed files with 624 additions and 2 deletions
|
@ -36,16 +36,18 @@ def dependencies(filename):
|
|||
dep = match.group(2) or match.group(3)
|
||||
if "util.popup" in dep or ("util" in line and "popup" in line):
|
||||
deps.append("tkinter")
|
||||
if ".datetimetz" in line:
|
||||
deps.extend(dependencies("bumblebee_status/modules/contrib/datetimetz.py"))
|
||||
elif not is_internal(dep):
|
||||
deps.append(dep)
|
||||
return deps
|
||||
|
||||
def write_test(testname, modname, deps):
|
||||
fqmn = ".".join(["modules", testname.split(os.sep)[2], modname])
|
||||
if not os.path.exists(testname):
|
||||
with open(testname, "w") as f:
|
||||
f.writelines([
|
||||
"import pytest\n\n",
|
||||
"import core.module\n\n",
|
||||
])
|
||||
for dep in deps:
|
||||
f.write("pytest.importorskip(\"{}\")\n\n".format(dep))
|
||||
|
@ -60,7 +62,7 @@ def write_test(testname, modname, deps):
|
|||
with open(testname, "a+") as f:
|
||||
f.writelines([
|
||||
"def test_load_module():\n",
|
||||
" core.module.load(\"{}\")\n\n".format(modname),
|
||||
" __import__(\"{}\")\n\n".format(fqmn),
|
||||
])
|
||||
|
||||
def main():
|
||||
|
|
5
tests/modules/contrib/test_amixer.py
Normal file
5
tests/modules/contrib/test_amixer.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.amixer")
|
||||
|
5
tests/modules/contrib/test_apt.py
Normal file
5
tests/modules/contrib/test_apt.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.apt")
|
||||
|
7
tests/modules/contrib/test_arandr.py
Normal file
7
tests/modules/contrib/test_arandr.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.arandr")
|
||||
|
5
tests/modules/contrib/test_arch-update.py
Normal file
5
tests/modules/contrib/test_arch-update.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.arch-update")
|
||||
|
7
tests/modules/contrib/test_battery-upower.py
Normal file
7
tests/modules/contrib/test_battery-upower.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("dbus")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.battery-upower")
|
||||
|
7
tests/modules/contrib/test_battery.py
Normal file
7
tests/modules/contrib/test_battery.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("power")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.battery")
|
||||
|
7
tests/modules/contrib/test_bluetooth.py
Normal file
7
tests/modules/contrib/test_bluetooth.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.bluetooth")
|
||||
|
11
tests/modules/contrib/test_bluetooth2.py
Normal file
11
tests/modules/contrib/test_bluetooth2.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("subprocess")
|
||||
|
||||
pytest.importorskip("dbus")
|
||||
|
||||
pytest.importorskip("dbus.mainloop.glib")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.bluetooth2")
|
||||
|
5
tests/modules/contrib/test_brightness.py
Normal file
5
tests/modules/contrib/test_brightness.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.brightness")
|
||||
|
7
tests/modules/contrib/test_caffeine.py
Normal file
7
tests/modules/contrib/test_caffeine.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.caffeine")
|
||||
|
5
tests/modules/contrib/test_cmus.py
Normal file
5
tests/modules/contrib/test_cmus.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.cmus")
|
||||
|
7
tests/modules/contrib/test_cpu2.py
Normal file
7
tests/modules/contrib/test_cpu2.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.cpu2")
|
||||
|
9
tests/modules/contrib/test_currency.py
Normal file
9
tests/modules/contrib/test_currency.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("babel.numbers")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.currency")
|
||||
|
11
tests/modules/contrib/test_datetimetz.py
Normal file
11
tests/modules/contrib/test_datetimetz.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
pytest.importorskip("pytz")
|
||||
|
||||
pytest.importorskip("tzlocal")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.datetimetz")
|
||||
|
11
tests/modules/contrib/test_datetz.py
Normal file
11
tests/modules/contrib/test_datetz.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
pytest.importorskip("pytz")
|
||||
|
||||
pytest.importorskip("tzlocal")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.datetz")
|
||||
|
7
tests/modules/contrib/test_deadbeef.py
Normal file
7
tests/modules/contrib/test_deadbeef.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("subprocess")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.deadbeef")
|
||||
|
7
tests/modules/contrib/test_deezer.py
Normal file
7
tests/modules/contrib/test_deezer.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("dbus")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.deezer")
|
||||
|
5
tests/modules/contrib/test_dnf.py
Normal file
5
tests/modules/contrib/test_dnf.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.dnf")
|
||||
|
9
tests/modules/contrib/test_docker_ps.py
Normal file
9
tests/modules/contrib/test_docker_ps.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("docker")
|
||||
|
||||
pytest.importorskip("requests.exceptions")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.docker_ps")
|
||||
|
5
tests/modules/contrib/test_dunst.py
Normal file
5
tests/modules/contrib/test_dunst.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.dunst")
|
||||
|
9
tests/modules/contrib/test_getcrypto.py
Normal file
9
tests/modules/contrib/test_getcrypto.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("requests.exceptions")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.getcrypto")
|
||||
|
7
tests/modules/contrib/test_github.py
Normal file
7
tests/modules/contrib/test_github.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.github")
|
||||
|
5
tests/modules/contrib/test_gpmdp.py
Normal file
5
tests/modules/contrib/test_gpmdp.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.gpmdp")
|
||||
|
7
tests/modules/contrib/test_hddtemp.py
Normal file
7
tests/modules/contrib/test_hddtemp.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("socket")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.hddtemp")
|
||||
|
5
tests/modules/contrib/test_hostname.py
Normal file
5
tests/modules/contrib/test_hostname.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.hostname")
|
||||
|
9
tests/modules/contrib/test_http_status.py
Normal file
9
tests/modules/contrib/test_http_status.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.http_status")
|
||||
|
5
tests/modules/contrib/test_indicator.py
Normal file
5
tests/modules/contrib/test_indicator.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.indicator")
|
||||
|
|
@ -21,4 +21,8 @@ def test_full_text(mocker, kernel_module):
|
|||
assert some_kernel == kernel_module.widget().full_text()
|
||||
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.kernel")
|
||||
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
5
tests/modules/contrib/test_layout-xkbswitch.py
Normal file
5
tests/modules/contrib/test_layout-xkbswitch.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.layout-xkbswitch")
|
||||
|
5
tests/modules/contrib/test_layout.py
Normal file
5
tests/modules/contrib/test_layout.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.layout")
|
||||
|
7
tests/modules/contrib/test_libvirtvms.py
Normal file
7
tests/modules/contrib/test_libvirtvms.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("libvirt")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.libvirtvms")
|
||||
|
7
tests/modules/contrib/test_messagereceiver.py
Normal file
7
tests/modules/contrib/test_messagereceiver.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("socket")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.messagereceiver")
|
||||
|
5
tests/modules/contrib/test_mocp.py
Normal file
5
tests/modules/contrib/test_mocp.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.mocp")
|
||||
|
|
@ -65,3 +65,8 @@ def test_update_calls_load_song(mocker, mpd_module):
|
|||
|
||||
def test_default_layout(mpd_module):
|
||||
assert mpd_module._layout == "mpd.prev mpd.main mpd.next mpd.shuffle mpd.repeat"
|
||||
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.mpd")
|
||||
|
||||
|
|
9
tests/modules/contrib/test_network_traffic.py
Normal file
9
tests/modules/contrib/test_network_traffic.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
pytest.importorskip("netifaces")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.network_traffic")
|
||||
|
5
tests/modules/contrib/test_notmuch_count.py
Normal file
5
tests/modules/contrib/test_notmuch_count.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.notmuch_count")
|
||||
|
5
tests/modules/contrib/test_nvidiagpu.py
Normal file
5
tests/modules/contrib/test_nvidiagpu.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.nvidiagpu")
|
||||
|
13
tests/modules/contrib/test_octoprint.py
Normal file
13
tests/modules/contrib/test_octoprint.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
pytest.importorskip("PIL")
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("simplejson")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.octoprint")
|
||||
|
7
tests/modules/contrib/test_pacman.py
Normal file
7
tests/modules/contrib/test_pacman.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("bumblebee_status.discover")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.pacman")
|
||||
|
7
tests/modules/contrib/test_pihole.py
Normal file
7
tests/modules/contrib/test_pihole.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.pihole")
|
||||
|
5
tests/modules/contrib/test_playerctl.py
Normal file
5
tests/modules/contrib/test_playerctl.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.playerctl")
|
||||
|
9
tests/modules/contrib/test_pomodoro.py
Normal file
9
tests/modules/contrib/test_pomodoro.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
pytest.importorskip("math")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.pomodoro")
|
||||
|
5
tests/modules/contrib/test_portage_status.py
Normal file
5
tests/modules/contrib/test_portage_status.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.portage_status")
|
||||
|
5
tests/modules/contrib/test_prime.py
Normal file
5
tests/modules/contrib/test_prime.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.prime")
|
||||
|
5
tests/modules/contrib/test_progress.py
Normal file
5
tests/modules/contrib/test_progress.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.progress")
|
||||
|
5
tests/modules/contrib/test_publicip.py
Normal file
5
tests/modules/contrib/test_publicip.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.publicip")
|
||||
|
5
tests/modules/contrib/test_rotation.py
Normal file
5
tests/modules/contrib/test_rotation.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.rotation")
|
||||
|
13
tests/modules/contrib/test_rss.py
Normal file
13
tests/modules/contrib/test_rss.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("feedparser")
|
||||
|
||||
pytest.importorskip("webbrowser")
|
||||
|
||||
pytest.importorskip("tempfile")
|
||||
|
||||
pytest.importorskip("random")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.rss")
|
||||
|
5
tests/modules/contrib/test_sensors.py
Normal file
5
tests/modules/contrib/test_sensors.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.sensors")
|
||||
|
7
tests/modules/contrib/test_shell.py
Normal file
7
tests/modules/contrib/test_shell.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("subprocess")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.shell")
|
||||
|
5
tests/modules/contrib/test_shortcut.py
Normal file
5
tests/modules/contrib/test_shortcut.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.shortcut")
|
||||
|
5
tests/modules/contrib/test_smartstatus.py
Normal file
5
tests/modules/contrib/test_smartstatus.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.smartstatus")
|
||||
|
7
tests/modules/contrib/test_spaceapi.py
Normal file
7
tests/modules/contrib/test_spaceapi.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.spaceapi")
|
||||
|
7
tests/modules/contrib/test_spotify.py
Normal file
7
tests/modules/contrib/test_spotify.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("dbus")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.spotify")
|
||||
|
7
tests/modules/contrib/test_stock.py
Normal file
7
tests/modules/contrib/test_stock.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("urllib.request")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.stock")
|
||||
|
13
tests/modules/contrib/test_sun.py
Normal file
13
tests/modules/contrib/test_sun.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("suntime")
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("dateutil.tz")
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.sun")
|
||||
|
11
tests/modules/contrib/test_system.py
Normal file
11
tests/modules/contrib/test_system.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.system")
|
||||
|
7
tests/modules/contrib/test_taskwarrior.py
Normal file
7
tests/modules/contrib/test_taskwarrior.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("taskw")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.taskwarrior")
|
||||
|
11
tests/modules/contrib/test_timetz.py
Normal file
11
tests/modules/contrib/test_timetz.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
pytest.importorskip("pytz")
|
||||
|
||||
pytest.importorskip("tzlocal")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.timetz")
|
||||
|
7
tests/modules/contrib/test_title.py
Normal file
7
tests/modules/contrib/test_title.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("i3ipc")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.title")
|
||||
|
5
tests/modules/contrib/test_todo.py
Normal file
5
tests/modules/contrib/test_todo.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.todo")
|
||||
|
9
tests/modules/contrib/test_traffic.py
Normal file
9
tests/modules/contrib/test_traffic.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
pytest.importorskip("netifaces")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.traffic")
|
||||
|
5
tests/modules/contrib/test_twmn.py
Normal file
5
tests/modules/contrib/test_twmn.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.twmn")
|
||||
|
7
tests/modules/contrib/test_uptime.py
Normal file
7
tests/modules/contrib/test_uptime.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.uptime")
|
||||
|
7
tests/modules/contrib/test_vpn.py
Normal file
7
tests/modules/contrib/test_vpn.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.vpn")
|
||||
|
5
tests/modules/contrib/test_watson.py
Normal file
5
tests/modules/contrib/test_watson.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.watson")
|
||||
|
9
tests/modules/contrib/test_weather.py
Normal file
9
tests/modules/contrib/test_weather.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("requests")
|
||||
|
||||
pytest.importorskip("requests.exceptions")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.weather")
|
||||
|
5
tests/modules/contrib/test_xkcd.py
Normal file
5
tests/modules/contrib/test_xkcd.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.xkcd")
|
||||
|
7
tests/modules/contrib/test_yubikey.py
Normal file
7
tests/modules/contrib/test_yubikey.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("yubico")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.yubikey")
|
||||
|
7
tests/modules/contrib/test_zpool.py
Normal file
7
tests/modules/contrib/test_zpool.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("pkg_resources")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.contrib.zpool")
|
||||
|
7
tests/modules/core/test_cpu.py
Normal file
7
tests/modules/core/test_cpu.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("psutil")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.cpu")
|
||||
|
5
tests/modules/core/test_date.py
Normal file
5
tests/modules/core/test_date.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.date")
|
||||
|
7
tests/modules/core/test_datetime.py
Normal file
7
tests/modules/core/test_datetime.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("datetime")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.datetime")
|
||||
|
5
tests/modules/core/test_debug.py
Normal file
5
tests/modules/core/test_debug.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.debug")
|
||||
|
5
tests/modules/core/test_disk.py
Normal file
5
tests/modules/core/test_disk.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.disk")
|
||||
|
5
tests/modules/core/test_error.py
Normal file
5
tests/modules/core/test_error.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.error")
|
||||
|
7
tests/modules/core/test_git.py
Normal file
7
tests/modules/core/test_git.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("pygit2")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.git")
|
||||
|
7
tests/modules/core/test_layout-xkb.py
Normal file
7
tests/modules/core/test_layout-xkb.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("xkbgroup")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.layout-xkb")
|
||||
|
7
tests/modules/core/test_load.py
Normal file
7
tests/modules/core/test_load.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("multiprocessing")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.load")
|
||||
|
5
tests/modules/core/test_memory.py
Normal file
5
tests/modules/core/test_memory.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.memory")
|
||||
|
9
tests/modules/core/test_nic.py
Normal file
9
tests/modules/core/test_nic.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("netifaces")
|
||||
|
||||
pytest.importorskip("subprocess")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.nic")
|
||||
|
5
tests/modules/core/test_pasink.py
Normal file
5
tests/modules/core/test_pasink.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pasink")
|
||||
|
5
tests/modules/core/test_pasource.py
Normal file
5
tests/modules/core/test_pasource.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pasource")
|
||||
|
5
tests/modules/core/test_ping.py
Normal file
5
tests/modules/core/test_ping.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.ping")
|
||||
|
5
tests/modules/core/test_pulseaudio.py
Normal file
5
tests/modules/core/test_pulseaudio.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.pulseaudio")
|
||||
|
5
tests/modules/core/test_redshift.py
Normal file
5
tests/modules/core/test_redshift.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.redshift")
|
||||
|
5
tests/modules/core/test_sensors2.py
Normal file
5
tests/modules/core/test_sensors2.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.sensors2")
|
||||
|
5
tests/modules/core/test_spacer.py
Normal file
5
tests/modules/core/test_spacer.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.spacer")
|
||||
|
7
tests/modules/core/test_speedtest.py
Normal file
7
tests/modules/core/test_speedtest.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("speedtest")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.speedtest")
|
||||
|
5
tests/modules/core/test_test.py
Normal file
5
tests/modules/core/test_test.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.test")
|
||||
|
5
tests/modules/core/test_time.py
Normal file
5
tests/modules/core/test_time.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pytest
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.time")
|
||||
|
7
tests/modules/core/test_vault.py
Normal file
7
tests/modules/core/test_vault.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("tkinter")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.vault")
|
||||
|
9
tests/modules/core/test_xrandr.py
Normal file
9
tests/modules/core/test_xrandr.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import pytest
|
||||
|
||||
pytest.importorskip("bumblebee_status.discover")
|
||||
|
||||
pytest.importorskip("i3")
|
||||
|
||||
def test_load_module():
|
||||
__import__("modules.core.xrandr")
|
||||
|
Loading…
Reference in a new issue