Skip to content

Commit

Permalink
TST: Add check_project test, add looseversion to testing deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Nov 6, 2023
1 parent d4a945b commit 55d962e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion migas/tests/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
from datetime import timezone as tz
import time

from looseversion import LooseVersion
import pytest

from migas import __version__
from migas.operations import add_breadcrumb, add_project, get_usage
from migas.operations import (
add_breadcrumb,
add_project,
check_project,
get_usage,
)

from .utils import do_server_tests

Expand Down Expand Up @@ -75,3 +81,14 @@ def test_add_project(setup_migas):
res = add_project(test_project, __version__, status='wtf')
assert res['success'] is False
assert res['latest_version'] is None


def test_check_project(setup_migas):
res = check_project(test_project, __version__)
assert res['success'] is True
assert res['latest']
v = LooseVersion(__version__)
latest = LooseVersion(res['latest'])
assert v >= latest
assert res['flagged'] is False
assert res['message'] == ''
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dev = [
test = [
"requests",
"pytest",
"looseversion",
]

#
Expand Down

0 comments on commit 55d962e

Please sign in to comment.