# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2016 Continuum Analytics, Inc.
#
# May be copied and distributed freely only as part of an Anaconda or
# Miniconda installation.
# -----------------------------------------------------------------------------
"""Api client tets."""

# Local imports
from anaconda_navigator.api import client_api


def test_dependencies():
    deplist = ['python 3.5*', 'qt 5.6.0', 'sip >=4.18']

    assert not client_api.is_dependency_met(deplist, '4.17.1', 'sip')
    assert client_api.is_dependency_met(deplist, '4.18', 'sip')
    assert client_api.is_dependency_met(deplist, '4.25.5', 'sip')

    assert client_api.is_dependency_met(deplist, '3.5', 'python')
    assert client_api.is_dependency_met(deplist, '3.5.1', 'python')
    assert not client_api.is_dependency_met(deplist, '3.4.5', 'python')

    assert client_api.is_dependency_met(deplist, '5.6.0', 'qt')
    assert not client_api.is_dependency_met(deplist, '5.6.0.1', 'python')
    assert not client_api.is_dependency_met(deplist, '5.7', 'python')
    assert not client_api.is_dependency_met(deplist, '5.5.9', 'python')
