added basic main
This commit is contained in:
parent
3eb045cd4a
commit
f6a8e260d5
3 changed files with 58 additions and 0 deletions
29
test/losoup/test_main.py
Normal file
29
test/losoup/test_main.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue