From 548ccc5e94f94b404cfddba2febb482096a3d7d1 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Mon, 20 Jul 2020 13:56:18 +0200 Subject: [PATCH] [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 --- generate-base-tests.py | 6 ++++-- tests/modules/contrib/test_amixer.py | 5 +++++ tests/modules/contrib/test_apt.py | 5 +++++ tests/modules/contrib/test_arandr.py | 7 +++++++ tests/modules/contrib/test_arch-update.py | 5 +++++ tests/modules/contrib/test_battery-upower.py | 7 +++++++ tests/modules/contrib/test_battery.py | 7 +++++++ tests/modules/contrib/test_bluetooth.py | 7 +++++++ tests/modules/contrib/test_bluetooth2.py | 11 +++++++++++ tests/modules/contrib/test_brightness.py | 5 +++++ tests/modules/contrib/test_caffeine.py | 7 +++++++ tests/modules/contrib/test_cmus.py | 5 +++++ tests/modules/contrib/test_cpu2.py | 7 +++++++ tests/modules/contrib/test_currency.py | 9 +++++++++ tests/modules/contrib/test_datetimetz.py | 11 +++++++++++ tests/modules/contrib/test_datetz.py | 11 +++++++++++ tests/modules/contrib/test_deadbeef.py | 7 +++++++ tests/modules/contrib/test_deezer.py | 7 +++++++ tests/modules/contrib/test_dnf.py | 5 +++++ tests/modules/contrib/test_docker_ps.py | 9 +++++++++ tests/modules/contrib/test_dunst.py | 5 +++++ tests/modules/contrib/test_getcrypto.py | 9 +++++++++ tests/modules/contrib/test_github.py | 7 +++++++ tests/modules/contrib/test_gpmdp.py | 5 +++++ tests/modules/contrib/test_hddtemp.py | 7 +++++++ tests/modules/contrib/test_hostname.py | 5 +++++ tests/modules/contrib/test_http_status.py | 9 +++++++++ tests/modules/contrib/test_indicator.py | 5 +++++ tests/modules/contrib/test_kernel.py | 4 ++++ tests/modules/contrib/test_layout-xkbswitch.py | 5 +++++ tests/modules/contrib/test_layout.py | 5 +++++ tests/modules/contrib/test_libvirtvms.py | 7 +++++++ tests/modules/contrib/test_messagereceiver.py | 7 +++++++ tests/modules/contrib/test_mocp.py | 5 +++++ tests/modules/contrib/test_mpd.py | 5 +++++ tests/modules/contrib/test_network_traffic.py | 9 +++++++++ tests/modules/contrib/test_notmuch_count.py | 5 +++++ tests/modules/contrib/test_nvidiagpu.py | 5 +++++ tests/modules/contrib/test_octoprint.py | 13 +++++++++++++ tests/modules/contrib/test_pacman.py | 7 +++++++ tests/modules/contrib/test_pihole.py | 7 +++++++ tests/modules/contrib/test_playerctl.py | 5 +++++ tests/modules/contrib/test_pomodoro.py | 9 +++++++++ tests/modules/contrib/test_portage_status.py | 5 +++++ tests/modules/contrib/test_prime.py | 5 +++++ tests/modules/contrib/test_progress.py | 5 +++++ tests/modules/contrib/test_publicip.py | 5 +++++ tests/modules/contrib/test_rotation.py | 5 +++++ tests/modules/contrib/test_rss.py | 13 +++++++++++++ tests/modules/contrib/test_sensors.py | 5 +++++ tests/modules/contrib/test_shell.py | 7 +++++++ tests/modules/contrib/test_shortcut.py | 5 +++++ tests/modules/contrib/test_smartstatus.py | 5 +++++ tests/modules/contrib/test_spaceapi.py | 7 +++++++ tests/modules/contrib/test_spotify.py | 7 +++++++ tests/modules/contrib/test_stock.py | 7 +++++++ tests/modules/contrib/test_sun.py | 13 +++++++++++++ tests/modules/contrib/test_system.py | 11 +++++++++++ tests/modules/contrib/test_taskwarrior.py | 7 +++++++ tests/modules/contrib/test_timetz.py | 11 +++++++++++ tests/modules/contrib/test_title.py | 7 +++++++ tests/modules/contrib/test_todo.py | 5 +++++ tests/modules/contrib/test_traffic.py | 9 +++++++++ tests/modules/contrib/test_twmn.py | 5 +++++ tests/modules/contrib/test_uptime.py | 7 +++++++ tests/modules/contrib/test_vpn.py | 7 +++++++ tests/modules/contrib/test_watson.py | 5 +++++ tests/modules/contrib/test_weather.py | 9 +++++++++ tests/modules/contrib/test_xkcd.py | 5 +++++ tests/modules/contrib/test_yubikey.py | 7 +++++++ tests/modules/contrib/test_zpool.py | 7 +++++++ tests/modules/core/test_cpu.py | 7 +++++++ tests/modules/core/test_date.py | 5 +++++ tests/modules/core/test_datetime.py | 7 +++++++ tests/modules/core/test_debug.py | 5 +++++ tests/modules/core/test_disk.py | 5 +++++ tests/modules/core/test_error.py | 5 +++++ tests/modules/core/test_git.py | 7 +++++++ tests/modules/core/test_layout-xkb.py | 7 +++++++ tests/modules/core/test_load.py | 7 +++++++ tests/modules/core/test_memory.py | 5 +++++ tests/modules/core/test_nic.py | 9 +++++++++ tests/modules/core/test_pasink.py | 5 +++++ tests/modules/core/test_pasource.py | 5 +++++ tests/modules/core/test_ping.py | 5 +++++ tests/modules/core/test_pulseaudio.py | 5 +++++ tests/modules/core/test_redshift.py | 5 +++++ tests/modules/core/test_sensors2.py | 5 +++++ tests/modules/core/test_spacer.py | 5 +++++ tests/modules/core/test_speedtest.py | 7 +++++++ tests/modules/core/test_test.py | 5 +++++ tests/modules/core/test_time.py | 5 +++++ tests/modules/core/test_vault.py | 7 +++++++ tests/modules/core/test_xrandr.py | 9 +++++++++ 94 files changed, 624 insertions(+), 2 deletions(-) create mode 100644 tests/modules/contrib/test_amixer.py create mode 100644 tests/modules/contrib/test_apt.py create mode 100644 tests/modules/contrib/test_arandr.py create mode 100644 tests/modules/contrib/test_arch-update.py create mode 100644 tests/modules/contrib/test_battery-upower.py create mode 100644 tests/modules/contrib/test_battery.py create mode 100644 tests/modules/contrib/test_bluetooth.py create mode 100644 tests/modules/contrib/test_bluetooth2.py create mode 100644 tests/modules/contrib/test_brightness.py create mode 100644 tests/modules/contrib/test_caffeine.py create mode 100644 tests/modules/contrib/test_cmus.py create mode 100644 tests/modules/contrib/test_cpu2.py create mode 100644 tests/modules/contrib/test_currency.py create mode 100644 tests/modules/contrib/test_datetimetz.py create mode 100644 tests/modules/contrib/test_datetz.py create mode 100644 tests/modules/contrib/test_deadbeef.py create mode 100644 tests/modules/contrib/test_deezer.py create mode 100644 tests/modules/contrib/test_dnf.py create mode 100644 tests/modules/contrib/test_docker_ps.py create mode 100644 tests/modules/contrib/test_dunst.py create mode 100644 tests/modules/contrib/test_getcrypto.py create mode 100644 tests/modules/contrib/test_github.py create mode 100644 tests/modules/contrib/test_gpmdp.py create mode 100644 tests/modules/contrib/test_hddtemp.py create mode 100644 tests/modules/contrib/test_hostname.py create mode 100644 tests/modules/contrib/test_http_status.py create mode 100644 tests/modules/contrib/test_indicator.py create mode 100644 tests/modules/contrib/test_layout-xkbswitch.py create mode 100644 tests/modules/contrib/test_layout.py create mode 100644 tests/modules/contrib/test_libvirtvms.py create mode 100644 tests/modules/contrib/test_messagereceiver.py create mode 100644 tests/modules/contrib/test_mocp.py create mode 100644 tests/modules/contrib/test_network_traffic.py create mode 100644 tests/modules/contrib/test_notmuch_count.py create mode 100644 tests/modules/contrib/test_nvidiagpu.py create mode 100644 tests/modules/contrib/test_octoprint.py create mode 100644 tests/modules/contrib/test_pacman.py create mode 100644 tests/modules/contrib/test_pihole.py create mode 100644 tests/modules/contrib/test_playerctl.py create mode 100644 tests/modules/contrib/test_pomodoro.py create mode 100644 tests/modules/contrib/test_portage_status.py create mode 100644 tests/modules/contrib/test_prime.py create mode 100644 tests/modules/contrib/test_progress.py create mode 100644 tests/modules/contrib/test_publicip.py create mode 100644 tests/modules/contrib/test_rotation.py create mode 100644 tests/modules/contrib/test_rss.py create mode 100644 tests/modules/contrib/test_sensors.py create mode 100644 tests/modules/contrib/test_shell.py create mode 100644 tests/modules/contrib/test_shortcut.py create mode 100644 tests/modules/contrib/test_smartstatus.py create mode 100644 tests/modules/contrib/test_spaceapi.py create mode 100644 tests/modules/contrib/test_spotify.py create mode 100644 tests/modules/contrib/test_stock.py create mode 100644 tests/modules/contrib/test_sun.py create mode 100644 tests/modules/contrib/test_system.py create mode 100644 tests/modules/contrib/test_taskwarrior.py create mode 100644 tests/modules/contrib/test_timetz.py create mode 100644 tests/modules/contrib/test_title.py create mode 100644 tests/modules/contrib/test_todo.py create mode 100644 tests/modules/contrib/test_traffic.py create mode 100644 tests/modules/contrib/test_twmn.py create mode 100644 tests/modules/contrib/test_uptime.py create mode 100644 tests/modules/contrib/test_vpn.py create mode 100644 tests/modules/contrib/test_watson.py create mode 100644 tests/modules/contrib/test_weather.py create mode 100644 tests/modules/contrib/test_xkcd.py create mode 100644 tests/modules/contrib/test_yubikey.py create mode 100644 tests/modules/contrib/test_zpool.py create mode 100644 tests/modules/core/test_cpu.py create mode 100644 tests/modules/core/test_date.py create mode 100644 tests/modules/core/test_datetime.py create mode 100644 tests/modules/core/test_debug.py create mode 100644 tests/modules/core/test_disk.py create mode 100644 tests/modules/core/test_error.py create mode 100644 tests/modules/core/test_git.py create mode 100644 tests/modules/core/test_layout-xkb.py create mode 100644 tests/modules/core/test_load.py create mode 100644 tests/modules/core/test_memory.py create mode 100644 tests/modules/core/test_nic.py create mode 100644 tests/modules/core/test_pasink.py create mode 100644 tests/modules/core/test_pasource.py create mode 100644 tests/modules/core/test_ping.py create mode 100644 tests/modules/core/test_pulseaudio.py create mode 100644 tests/modules/core/test_redshift.py create mode 100644 tests/modules/core/test_sensors2.py create mode 100644 tests/modules/core/test_spacer.py create mode 100644 tests/modules/core/test_speedtest.py create mode 100644 tests/modules/core/test_test.py create mode 100644 tests/modules/core/test_time.py create mode 100644 tests/modules/core/test_vault.py create mode 100644 tests/modules/core/test_xrandr.py diff --git a/generate-base-tests.py b/generate-base-tests.py index 2c08165..03efc37 100755 --- a/generate-base-tests.py +++ b/generate-base-tests.py @@ -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(): diff --git a/tests/modules/contrib/test_amixer.py b/tests/modules/contrib/test_amixer.py new file mode 100644 index 0000000..b1cfbf0 --- /dev/null +++ b/tests/modules/contrib/test_amixer.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.amixer") + diff --git a/tests/modules/contrib/test_apt.py b/tests/modules/contrib/test_apt.py new file mode 100644 index 0000000..7b151bb --- /dev/null +++ b/tests/modules/contrib/test_apt.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.apt") + diff --git a/tests/modules/contrib/test_arandr.py b/tests/modules/contrib/test_arandr.py new file mode 100644 index 0000000..130d858 --- /dev/null +++ b/tests/modules/contrib/test_arandr.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("tkinter") + +def test_load_module(): + __import__("modules.contrib.arandr") + diff --git a/tests/modules/contrib/test_arch-update.py b/tests/modules/contrib/test_arch-update.py new file mode 100644 index 0000000..6a1c172 --- /dev/null +++ b/tests/modules/contrib/test_arch-update.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.arch-update") + diff --git a/tests/modules/contrib/test_battery-upower.py b/tests/modules/contrib/test_battery-upower.py new file mode 100644 index 0000000..cb62a16 --- /dev/null +++ b/tests/modules/contrib/test_battery-upower.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("dbus") + +def test_load_module(): + __import__("modules.contrib.battery-upower") + diff --git a/tests/modules/contrib/test_battery.py b/tests/modules/contrib/test_battery.py new file mode 100644 index 0000000..41c865c --- /dev/null +++ b/tests/modules/contrib/test_battery.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("power") + +def test_load_module(): + __import__("modules.contrib.battery") + diff --git a/tests/modules/contrib/test_bluetooth.py b/tests/modules/contrib/test_bluetooth.py new file mode 100644 index 0000000..b069bb1 --- /dev/null +++ b/tests/modules/contrib/test_bluetooth.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("tkinter") + +def test_load_module(): + __import__("modules.contrib.bluetooth") + diff --git a/tests/modules/contrib/test_bluetooth2.py b/tests/modules/contrib/test_bluetooth2.py new file mode 100644 index 0000000..0ebcdf8 --- /dev/null +++ b/tests/modules/contrib/test_bluetooth2.py @@ -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") + diff --git a/tests/modules/contrib/test_brightness.py b/tests/modules/contrib/test_brightness.py new file mode 100644 index 0000000..023682e --- /dev/null +++ b/tests/modules/contrib/test_brightness.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.brightness") + diff --git a/tests/modules/contrib/test_caffeine.py b/tests/modules/contrib/test_caffeine.py new file mode 100644 index 0000000..cc13ab4 --- /dev/null +++ b/tests/modules/contrib/test_caffeine.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("psutil") + +def test_load_module(): + __import__("modules.contrib.caffeine") + diff --git a/tests/modules/contrib/test_cmus.py b/tests/modules/contrib/test_cmus.py new file mode 100644 index 0000000..03458b0 --- /dev/null +++ b/tests/modules/contrib/test_cmus.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.cmus") + diff --git a/tests/modules/contrib/test_cpu2.py b/tests/modules/contrib/test_cpu2.py new file mode 100644 index 0000000..bbb2756 --- /dev/null +++ b/tests/modules/contrib/test_cpu2.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("psutil") + +def test_load_module(): + __import__("modules.contrib.cpu2") + diff --git a/tests/modules/contrib/test_currency.py b/tests/modules/contrib/test_currency.py new file mode 100644 index 0000000..0762ea3 --- /dev/null +++ b/tests/modules/contrib/test_currency.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("requests") + +pytest.importorskip("babel.numbers") + +def test_load_module(): + __import__("modules.contrib.currency") + diff --git a/tests/modules/contrib/test_datetimetz.py b/tests/modules/contrib/test_datetimetz.py new file mode 100644 index 0000000..315d35b --- /dev/null +++ b/tests/modules/contrib/test_datetimetz.py @@ -0,0 +1,11 @@ +import pytest + +pytest.importorskip("datetime") + +pytest.importorskip("pytz") + +pytest.importorskip("tzlocal") + +def test_load_module(): + __import__("modules.contrib.datetimetz") + diff --git a/tests/modules/contrib/test_datetz.py b/tests/modules/contrib/test_datetz.py new file mode 100644 index 0000000..ae15f67 --- /dev/null +++ b/tests/modules/contrib/test_datetz.py @@ -0,0 +1,11 @@ +import pytest + +pytest.importorskip("datetime") + +pytest.importorskip("pytz") + +pytest.importorskip("tzlocal") + +def test_load_module(): + __import__("modules.contrib.datetz") + diff --git a/tests/modules/contrib/test_deadbeef.py b/tests/modules/contrib/test_deadbeef.py new file mode 100644 index 0000000..5d98401 --- /dev/null +++ b/tests/modules/contrib/test_deadbeef.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("subprocess") + +def test_load_module(): + __import__("modules.contrib.deadbeef") + diff --git a/tests/modules/contrib/test_deezer.py b/tests/modules/contrib/test_deezer.py new file mode 100644 index 0000000..6bb507e --- /dev/null +++ b/tests/modules/contrib/test_deezer.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("dbus") + +def test_load_module(): + __import__("modules.contrib.deezer") + diff --git a/tests/modules/contrib/test_dnf.py b/tests/modules/contrib/test_dnf.py new file mode 100644 index 0000000..858fb5b --- /dev/null +++ b/tests/modules/contrib/test_dnf.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.dnf") + diff --git a/tests/modules/contrib/test_docker_ps.py b/tests/modules/contrib/test_docker_ps.py new file mode 100644 index 0000000..fcae290 --- /dev/null +++ b/tests/modules/contrib/test_docker_ps.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("docker") + +pytest.importorskip("requests.exceptions") + +def test_load_module(): + __import__("modules.contrib.docker_ps") + diff --git a/tests/modules/contrib/test_dunst.py b/tests/modules/contrib/test_dunst.py new file mode 100644 index 0000000..2ca2d40 --- /dev/null +++ b/tests/modules/contrib/test_dunst.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.dunst") + diff --git a/tests/modules/contrib/test_getcrypto.py b/tests/modules/contrib/test_getcrypto.py new file mode 100644 index 0000000..07a7ada --- /dev/null +++ b/tests/modules/contrib/test_getcrypto.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("requests") + +pytest.importorskip("requests.exceptions") + +def test_load_module(): + __import__("modules.contrib.getcrypto") + diff --git a/tests/modules/contrib/test_github.py b/tests/modules/contrib/test_github.py new file mode 100644 index 0000000..57e19d8 --- /dev/null +++ b/tests/modules/contrib/test_github.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("requests") + +def test_load_module(): + __import__("modules.contrib.github") + diff --git a/tests/modules/contrib/test_gpmdp.py b/tests/modules/contrib/test_gpmdp.py new file mode 100644 index 0000000..3ae9aa9 --- /dev/null +++ b/tests/modules/contrib/test_gpmdp.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.gpmdp") + diff --git a/tests/modules/contrib/test_hddtemp.py b/tests/modules/contrib/test_hddtemp.py new file mode 100644 index 0000000..20f2343 --- /dev/null +++ b/tests/modules/contrib/test_hddtemp.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("socket") + +def test_load_module(): + __import__("modules.contrib.hddtemp") + diff --git a/tests/modules/contrib/test_hostname.py b/tests/modules/contrib/test_hostname.py new file mode 100644 index 0000000..e76adb7 --- /dev/null +++ b/tests/modules/contrib/test_hostname.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.hostname") + diff --git a/tests/modules/contrib/test_http_status.py b/tests/modules/contrib/test_http_status.py new file mode 100644 index 0000000..9d9338b --- /dev/null +++ b/tests/modules/contrib/test_http_status.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("requests") + +pytest.importorskip("psutil") + +def test_load_module(): + __import__("modules.contrib.http_status") + diff --git a/tests/modules/contrib/test_indicator.py b/tests/modules/contrib/test_indicator.py new file mode 100644 index 0000000..f94fc53 --- /dev/null +++ b/tests/modules/contrib/test_indicator.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.indicator") + diff --git a/tests/modules/contrib/test_kernel.py b/tests/modules/contrib/test_kernel.py index 9953132..f74021d 100644 --- a/tests/modules/contrib/test_kernel.py +++ b/tests/modules/contrib/test_kernel.py @@ -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 diff --git a/tests/modules/contrib/test_layout-xkbswitch.py b/tests/modules/contrib/test_layout-xkbswitch.py new file mode 100644 index 0000000..08cfd96 --- /dev/null +++ b/tests/modules/contrib/test_layout-xkbswitch.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.layout-xkbswitch") + diff --git a/tests/modules/contrib/test_layout.py b/tests/modules/contrib/test_layout.py new file mode 100644 index 0000000..61895ab --- /dev/null +++ b/tests/modules/contrib/test_layout.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.layout") + diff --git a/tests/modules/contrib/test_libvirtvms.py b/tests/modules/contrib/test_libvirtvms.py new file mode 100644 index 0000000..efa5880 --- /dev/null +++ b/tests/modules/contrib/test_libvirtvms.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("libvirt") + +def test_load_module(): + __import__("modules.contrib.libvirtvms") + diff --git a/tests/modules/contrib/test_messagereceiver.py b/tests/modules/contrib/test_messagereceiver.py new file mode 100644 index 0000000..a4fbcca --- /dev/null +++ b/tests/modules/contrib/test_messagereceiver.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("socket") + +def test_load_module(): + __import__("modules.contrib.messagereceiver") + diff --git a/tests/modules/contrib/test_mocp.py b/tests/modules/contrib/test_mocp.py new file mode 100644 index 0000000..8f2ffcc --- /dev/null +++ b/tests/modules/contrib/test_mocp.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.mocp") + diff --git a/tests/modules/contrib/test_mpd.py b/tests/modules/contrib/test_mpd.py index 1fb48da..8664b43 100644 --- a/tests/modules/contrib/test_mpd.py +++ b/tests/modules/contrib/test_mpd.py @@ -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") + diff --git a/tests/modules/contrib/test_network_traffic.py b/tests/modules/contrib/test_network_traffic.py new file mode 100644 index 0000000..0dd52a9 --- /dev/null +++ b/tests/modules/contrib/test_network_traffic.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("psutil") + +pytest.importorskip("netifaces") + +def test_load_module(): + __import__("modules.contrib.network_traffic") + diff --git a/tests/modules/contrib/test_notmuch_count.py b/tests/modules/contrib/test_notmuch_count.py new file mode 100644 index 0000000..37ca1cc --- /dev/null +++ b/tests/modules/contrib/test_notmuch_count.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.notmuch_count") + diff --git a/tests/modules/contrib/test_nvidiagpu.py b/tests/modules/contrib/test_nvidiagpu.py new file mode 100644 index 0000000..69cdc09 --- /dev/null +++ b/tests/modules/contrib/test_nvidiagpu.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.nvidiagpu") + diff --git a/tests/modules/contrib/test_octoprint.py b/tests/modules/contrib/test_octoprint.py new file mode 100644 index 0000000..8b8264b --- /dev/null +++ b/tests/modules/contrib/test_octoprint.py @@ -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") + diff --git a/tests/modules/contrib/test_pacman.py b/tests/modules/contrib/test_pacman.py new file mode 100644 index 0000000..1bd656e --- /dev/null +++ b/tests/modules/contrib/test_pacman.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("bumblebee_status.discover") + +def test_load_module(): + __import__("modules.contrib.pacman") + diff --git a/tests/modules/contrib/test_pihole.py b/tests/modules/contrib/test_pihole.py new file mode 100644 index 0000000..6d1849d --- /dev/null +++ b/tests/modules/contrib/test_pihole.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("requests") + +def test_load_module(): + __import__("modules.contrib.pihole") + diff --git a/tests/modules/contrib/test_playerctl.py b/tests/modules/contrib/test_playerctl.py new file mode 100644 index 0000000..f5e15a6 --- /dev/null +++ b/tests/modules/contrib/test_playerctl.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.playerctl") + diff --git a/tests/modules/contrib/test_pomodoro.py b/tests/modules/contrib/test_pomodoro.py new file mode 100644 index 0000000..d8557ca --- /dev/null +++ b/tests/modules/contrib/test_pomodoro.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("datetime") + +pytest.importorskip("math") + +def test_load_module(): + __import__("modules.contrib.pomodoro") + diff --git a/tests/modules/contrib/test_portage_status.py b/tests/modules/contrib/test_portage_status.py new file mode 100644 index 0000000..05fdd0f --- /dev/null +++ b/tests/modules/contrib/test_portage_status.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.portage_status") + diff --git a/tests/modules/contrib/test_prime.py b/tests/modules/contrib/test_prime.py new file mode 100644 index 0000000..8ccb0e3 --- /dev/null +++ b/tests/modules/contrib/test_prime.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.prime") + diff --git a/tests/modules/contrib/test_progress.py b/tests/modules/contrib/test_progress.py new file mode 100644 index 0000000..4d99931 --- /dev/null +++ b/tests/modules/contrib/test_progress.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.progress") + diff --git a/tests/modules/contrib/test_publicip.py b/tests/modules/contrib/test_publicip.py new file mode 100644 index 0000000..6c5a31a --- /dev/null +++ b/tests/modules/contrib/test_publicip.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.publicip") + diff --git a/tests/modules/contrib/test_rotation.py b/tests/modules/contrib/test_rotation.py new file mode 100644 index 0000000..7495828 --- /dev/null +++ b/tests/modules/contrib/test_rotation.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.rotation") + diff --git a/tests/modules/contrib/test_rss.py b/tests/modules/contrib/test_rss.py new file mode 100644 index 0000000..3a99569 --- /dev/null +++ b/tests/modules/contrib/test_rss.py @@ -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") + diff --git a/tests/modules/contrib/test_sensors.py b/tests/modules/contrib/test_sensors.py new file mode 100644 index 0000000..d32a30f --- /dev/null +++ b/tests/modules/contrib/test_sensors.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.sensors") + diff --git a/tests/modules/contrib/test_shell.py b/tests/modules/contrib/test_shell.py new file mode 100644 index 0000000..56ba0e8 --- /dev/null +++ b/tests/modules/contrib/test_shell.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("subprocess") + +def test_load_module(): + __import__("modules.contrib.shell") + diff --git a/tests/modules/contrib/test_shortcut.py b/tests/modules/contrib/test_shortcut.py new file mode 100644 index 0000000..52cc474 --- /dev/null +++ b/tests/modules/contrib/test_shortcut.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.shortcut") + diff --git a/tests/modules/contrib/test_smartstatus.py b/tests/modules/contrib/test_smartstatus.py new file mode 100644 index 0000000..04a84f9 --- /dev/null +++ b/tests/modules/contrib/test_smartstatus.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.smartstatus") + diff --git a/tests/modules/contrib/test_spaceapi.py b/tests/modules/contrib/test_spaceapi.py new file mode 100644 index 0000000..bedcb1c --- /dev/null +++ b/tests/modules/contrib/test_spaceapi.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("requests") + +def test_load_module(): + __import__("modules.contrib.spaceapi") + diff --git a/tests/modules/contrib/test_spotify.py b/tests/modules/contrib/test_spotify.py new file mode 100644 index 0000000..cf6a66b --- /dev/null +++ b/tests/modules/contrib/test_spotify.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("dbus") + +def test_load_module(): + __import__("modules.contrib.spotify") + diff --git a/tests/modules/contrib/test_stock.py b/tests/modules/contrib/test_stock.py new file mode 100644 index 0000000..3c4adb1 --- /dev/null +++ b/tests/modules/contrib/test_stock.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("urllib.request") + +def test_load_module(): + __import__("modules.contrib.stock") + diff --git a/tests/modules/contrib/test_sun.py b/tests/modules/contrib/test_sun.py new file mode 100644 index 0000000..3830ea6 --- /dev/null +++ b/tests/modules/contrib/test_sun.py @@ -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") + diff --git a/tests/modules/contrib/test_system.py b/tests/modules/contrib/test_system.py new file mode 100644 index 0000000..6f107a0 --- /dev/null +++ b/tests/modules/contrib/test_system.py @@ -0,0 +1,11 @@ +import pytest + +pytest.importorskip("tkinter") + +pytest.importorskip("tkinter") + +pytest.importorskip("tkinter") + +def test_load_module(): + __import__("modules.contrib.system") + diff --git a/tests/modules/contrib/test_taskwarrior.py b/tests/modules/contrib/test_taskwarrior.py new file mode 100644 index 0000000..ab6f08f --- /dev/null +++ b/tests/modules/contrib/test_taskwarrior.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("taskw") + +def test_load_module(): + __import__("modules.contrib.taskwarrior") + diff --git a/tests/modules/contrib/test_timetz.py b/tests/modules/contrib/test_timetz.py new file mode 100644 index 0000000..01e5879 --- /dev/null +++ b/tests/modules/contrib/test_timetz.py @@ -0,0 +1,11 @@ +import pytest + +pytest.importorskip("datetime") + +pytest.importorskip("pytz") + +pytest.importorskip("tzlocal") + +def test_load_module(): + __import__("modules.contrib.timetz") + diff --git a/tests/modules/contrib/test_title.py b/tests/modules/contrib/test_title.py new file mode 100644 index 0000000..089102b --- /dev/null +++ b/tests/modules/contrib/test_title.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("i3ipc") + +def test_load_module(): + __import__("modules.contrib.title") + diff --git a/tests/modules/contrib/test_todo.py b/tests/modules/contrib/test_todo.py new file mode 100644 index 0000000..203b30a --- /dev/null +++ b/tests/modules/contrib/test_todo.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.todo") + diff --git a/tests/modules/contrib/test_traffic.py b/tests/modules/contrib/test_traffic.py new file mode 100644 index 0000000..8711414 --- /dev/null +++ b/tests/modules/contrib/test_traffic.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("psutil") + +pytest.importorskip("netifaces") + +def test_load_module(): + __import__("modules.contrib.traffic") + diff --git a/tests/modules/contrib/test_twmn.py b/tests/modules/contrib/test_twmn.py new file mode 100644 index 0000000..11e3421 --- /dev/null +++ b/tests/modules/contrib/test_twmn.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.twmn") + diff --git a/tests/modules/contrib/test_uptime.py b/tests/modules/contrib/test_uptime.py new file mode 100644 index 0000000..67c791f --- /dev/null +++ b/tests/modules/contrib/test_uptime.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("datetime") + +def test_load_module(): + __import__("modules.contrib.uptime") + diff --git a/tests/modules/contrib/test_vpn.py b/tests/modules/contrib/test_vpn.py new file mode 100644 index 0000000..ef46640 --- /dev/null +++ b/tests/modules/contrib/test_vpn.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("tkinter") + +def test_load_module(): + __import__("modules.contrib.vpn") + diff --git a/tests/modules/contrib/test_watson.py b/tests/modules/contrib/test_watson.py new file mode 100644 index 0000000..6786f38 --- /dev/null +++ b/tests/modules/contrib/test_watson.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.watson") + diff --git a/tests/modules/contrib/test_weather.py b/tests/modules/contrib/test_weather.py new file mode 100644 index 0000000..ef4dc70 --- /dev/null +++ b/tests/modules/contrib/test_weather.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("requests") + +pytest.importorskip("requests.exceptions") + +def test_load_module(): + __import__("modules.contrib.weather") + diff --git a/tests/modules/contrib/test_xkcd.py b/tests/modules/contrib/test_xkcd.py new file mode 100644 index 0000000..35e00be --- /dev/null +++ b/tests/modules/contrib/test_xkcd.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.contrib.xkcd") + diff --git a/tests/modules/contrib/test_yubikey.py b/tests/modules/contrib/test_yubikey.py new file mode 100644 index 0000000..6b9d36a --- /dev/null +++ b/tests/modules/contrib/test_yubikey.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("yubico") + +def test_load_module(): + __import__("modules.contrib.yubikey") + diff --git a/tests/modules/contrib/test_zpool.py b/tests/modules/contrib/test_zpool.py new file mode 100644 index 0000000..5577e00 --- /dev/null +++ b/tests/modules/contrib/test_zpool.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("pkg_resources") + +def test_load_module(): + __import__("modules.contrib.zpool") + diff --git a/tests/modules/core/test_cpu.py b/tests/modules/core/test_cpu.py new file mode 100644 index 0000000..9ea85ed --- /dev/null +++ b/tests/modules/core/test_cpu.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("psutil") + +def test_load_module(): + __import__("modules.core.cpu") + diff --git a/tests/modules/core/test_date.py b/tests/modules/core/test_date.py new file mode 100644 index 0000000..b87e64b --- /dev/null +++ b/tests/modules/core/test_date.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.date") + diff --git a/tests/modules/core/test_datetime.py b/tests/modules/core/test_datetime.py new file mode 100644 index 0000000..b8384d9 --- /dev/null +++ b/tests/modules/core/test_datetime.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("datetime") + +def test_load_module(): + __import__("modules.core.datetime") + diff --git a/tests/modules/core/test_debug.py b/tests/modules/core/test_debug.py new file mode 100644 index 0000000..04305b2 --- /dev/null +++ b/tests/modules/core/test_debug.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.debug") + diff --git a/tests/modules/core/test_disk.py b/tests/modules/core/test_disk.py new file mode 100644 index 0000000..791ba48 --- /dev/null +++ b/tests/modules/core/test_disk.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.disk") + diff --git a/tests/modules/core/test_error.py b/tests/modules/core/test_error.py new file mode 100644 index 0000000..296fbd7 --- /dev/null +++ b/tests/modules/core/test_error.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.error") + diff --git a/tests/modules/core/test_git.py b/tests/modules/core/test_git.py new file mode 100644 index 0000000..62f67ad --- /dev/null +++ b/tests/modules/core/test_git.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("pygit2") + +def test_load_module(): + __import__("modules.core.git") + diff --git a/tests/modules/core/test_layout-xkb.py b/tests/modules/core/test_layout-xkb.py new file mode 100644 index 0000000..8eacfad --- /dev/null +++ b/tests/modules/core/test_layout-xkb.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("xkbgroup") + +def test_load_module(): + __import__("modules.core.layout-xkb") + diff --git a/tests/modules/core/test_load.py b/tests/modules/core/test_load.py new file mode 100644 index 0000000..2210f9e --- /dev/null +++ b/tests/modules/core/test_load.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("multiprocessing") + +def test_load_module(): + __import__("modules.core.load") + diff --git a/tests/modules/core/test_memory.py b/tests/modules/core/test_memory.py new file mode 100644 index 0000000..2b87b8a --- /dev/null +++ b/tests/modules/core/test_memory.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.memory") + diff --git a/tests/modules/core/test_nic.py b/tests/modules/core/test_nic.py new file mode 100644 index 0000000..e827eb3 --- /dev/null +++ b/tests/modules/core/test_nic.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("netifaces") + +pytest.importorskip("subprocess") + +def test_load_module(): + __import__("modules.core.nic") + diff --git a/tests/modules/core/test_pasink.py b/tests/modules/core/test_pasink.py new file mode 100644 index 0000000..2319e63 --- /dev/null +++ b/tests/modules/core/test_pasink.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.pasink") + diff --git a/tests/modules/core/test_pasource.py b/tests/modules/core/test_pasource.py new file mode 100644 index 0000000..88ef465 --- /dev/null +++ b/tests/modules/core/test_pasource.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.pasource") + diff --git a/tests/modules/core/test_ping.py b/tests/modules/core/test_ping.py new file mode 100644 index 0000000..269321a --- /dev/null +++ b/tests/modules/core/test_ping.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.ping") + diff --git a/tests/modules/core/test_pulseaudio.py b/tests/modules/core/test_pulseaudio.py new file mode 100644 index 0000000..66b69e3 --- /dev/null +++ b/tests/modules/core/test_pulseaudio.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.pulseaudio") + diff --git a/tests/modules/core/test_redshift.py b/tests/modules/core/test_redshift.py new file mode 100644 index 0000000..3f6f72f --- /dev/null +++ b/tests/modules/core/test_redshift.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.redshift") + diff --git a/tests/modules/core/test_sensors2.py b/tests/modules/core/test_sensors2.py new file mode 100644 index 0000000..59bd6e4 --- /dev/null +++ b/tests/modules/core/test_sensors2.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.sensors2") + diff --git a/tests/modules/core/test_spacer.py b/tests/modules/core/test_spacer.py new file mode 100644 index 0000000..b592e22 --- /dev/null +++ b/tests/modules/core/test_spacer.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.spacer") + diff --git a/tests/modules/core/test_speedtest.py b/tests/modules/core/test_speedtest.py new file mode 100644 index 0000000..51cc775 --- /dev/null +++ b/tests/modules/core/test_speedtest.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("speedtest") + +def test_load_module(): + __import__("modules.core.speedtest") + diff --git a/tests/modules/core/test_test.py b/tests/modules/core/test_test.py new file mode 100644 index 0000000..ede1244 --- /dev/null +++ b/tests/modules/core/test_test.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.test") + diff --git a/tests/modules/core/test_time.py b/tests/modules/core/test_time.py new file mode 100644 index 0000000..603a50d --- /dev/null +++ b/tests/modules/core/test_time.py @@ -0,0 +1,5 @@ +import pytest + +def test_load_module(): + __import__("modules.core.time") + diff --git a/tests/modules/core/test_vault.py b/tests/modules/core/test_vault.py new file mode 100644 index 0000000..eed6cc0 --- /dev/null +++ b/tests/modules/core/test_vault.py @@ -0,0 +1,7 @@ +import pytest + +pytest.importorskip("tkinter") + +def test_load_module(): + __import__("modules.core.vault") + diff --git a/tests/modules/core/test_xrandr.py b/tests/modules/core/test_xrandr.py new file mode 100644 index 0000000..b2d7120 --- /dev/null +++ b/tests/modules/core/test_xrandr.py @@ -0,0 +1,9 @@ +import pytest + +pytest.importorskip("bumblebee_status.discover") + +pytest.importorskip("i3") + +def test_load_module(): + __import__("modules.core.xrandr") +