# Path: eldonationtracker/utils/update_available.py
# def update_available(pypi_version: str, current_version: str) -> bool:
#     """Use semver module to calculate whether there is a newer version on PyPi.
# 
#     :return: True if the PyPi version is higher than the version being run.\
#     Returns false if the version being compared to PyPi is equal or greater\
#     than the PyPi version."""
#     if semver.compare(pypi_version, current_version) == 1:
#         update_log.info(f"There is an update available. PyPi version: {pypi_version}")
#         return True
#     else:
#         update_log.info("You have the latest version.")
#         return False


from unittest import mock
from eldonationtracker.utils import update_available
    """Test to make sure if the patch version on PyPi is higher, it returns True."""
    pypi_version = "2.0.1"
    pkg_current_version = "2.0.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update


def test_up_to_date_major():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.0.0"
    pkg_current_version = "2.0.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update is False


def test_up_to_date_minor():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.1.0"
    pkg_current_version = "2.1.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update is False


def test_up_to_date_patch():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.1.1"
    pkg_current_version = "2.1.1"

# Path: eldonationtracker/utils/update_available.py
# def update_available(pypi_version: str, current_version: str) -> bool:
#     """Use semver module to calculate whether there is a newer version on PyPi.
# 
#     :return: True if the PyPi version is higher than the version being run.\
#     Returns false if the version being compared to PyPi is equal or greater\
#     than the PyPi version."""
#     if semver.compare(pypi_version, current_version) == 1:
#         update_log.info(f"There is an update available. PyPi version: {pypi_version}")
#         return True
#     else:
#         update_log.info("You have the latest version.")
#         return False


# Path: eldonationtracker/utils/tests/test_update_available.py
from unittest import mock
from eldonationtracker.utils import update_available

    """Test to make sure if the patch version on PyPi is higher, it returns True."""
    pypi_version = "2.0.1"
    pkg_current_version = "2.0.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update


def test_up_to_date_major():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.0.0"
    pkg_current_version = "2.0.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update is False


def test_up_to_date_minor():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.1.0"
    pkg_current_version = "2.1.0"
    update = update_available.update_available(pypi_version,
                                               pkg_current_version)
    assert update is False


def test_up_to_date_patch():
    """Test to make sure if the version is up to date, it returns false."""
    pypi_version = "2.1.1"
    pkg_current_version = "2.1.1"

    update = update_available.update_available(pypi_version,