29 lines
762 B
Python
29 lines
762 B
Python
from pathlib import Path
|
|
|
|
from losoup import main
|
|
from losoup.models import GithubSoftware
|
|
|
|
|
|
def test_read_files():
|
|
cur_dir = Path(__file__).parent
|
|
software_file = cur_dir / "software.yaml"
|
|
|
|
files = main.load_software_list(software_file)
|
|
|
|
assert len(files) == 2
|
|
|
|
nextcloud = files[0]
|
|
assert nextcloud.name == "NextCloud"
|
|
assert isinstance(nextcloud, GithubSoftware)
|
|
|
|
keepassxc = files[1]
|
|
assert keepassxc.name == "KeePassXC"
|
|
assert isinstance(nextcloud, GithubSoftware)
|
|
|
|
|
|
def test_software_needs_to_be_updated(software_to_update):
|
|
assert main.is_software_to_update(software_to_update)
|
|
|
|
|
|
def test_software_does_not_need_to_be_updated(software_up_to_date):
|
|
assert not main.is_software_to_update(software_up_to_date)
|