gnome-extension-download-url/tests/test_check_gnome_shell_vers...

47 lines
1.9 KiB
Python

from src.gnome_extension_download_url.__main__ import check_gnome_shell_version
def test_check_gnome_shell_version_ok():
assert check_gnome_shell_version("3.38", [
{"major": 3, "minor": 36, "point": -1},
{"major": 3, "minor": 37, "point": -1},
{"major": 3, "minor": 38, "point": -1},
])
assert check_gnome_shell_version("3.38.1", [
{"major": 3, "minor": 36, "point": -1},
{"major": 3, "minor": 37, "point": -1},
{"major": 3, "minor": 38, "point": -1},
{"major": 3, "minor": 38, "point": 1},
])
assert check_gnome_shell_version("46", [
{"major": 3, "minor": 36, "point": -1},
{"major": 3, "minor": 37, "point": -1},
{"major": 3, "minor": 38, "point": -1},
{"major": 40, "minor": -1, "point": -1},
{"major": 41, "minor": -1, "point": -1},
{"major": 42, "minor": -1, "point": -1},
{"major": 43, "minor": -1, "point": -1},
{"major": 44, "minor": -1, "point": -1},
{"major": 45, "minor": -1, "point": -1},
{"major": 46, "minor": -1, "point": -1},
])
def test_check_gnome_shell_version_not_ok():
assert not check_gnome_shell_version("3.38", [])
assert not check_gnome_shell_version("3.38.1", [
{"major": 3, "minor": 36, "point": -1},
{"major": 3, "minor": 37, "point": -1},
{"major": 3, "minor": 38, "point": -1},
])
assert not check_gnome_shell_version("46", [
{"major": 3, "minor": 36, "point": -1},
{"major": 3, "minor": 37, "point": -1},
{"major": 3, "minor": 38, "point": -1},
{"major": 40, "minor": -1, "point": -1},
{"major": 41, "minor": -1, "point": -1},
{"major": 42, "minor": -1, "point": -1},
{"major": 43, "minor": -1, "point": -1},
{"major": 44, "minor": -1, "point": -1},
{"major": 45, "minor": -1, "point": -1},
])