Example #1
0
def test_parse_constraints_multi2(parser, input):
    first = Constraint('>', '2.0.0.0')
    second = Constraint('<', '2.0.5.0')
    third = Constraint('>', '2.0.6.0')
    multi1 = MultiConstraint((first, second))
    multi2 = MultiConstraint((multi1, third), False)

    assert str(parser.parse_constraints(input)) == str(multi2)
def test_multi_version_match_succeeds():
    require_start = Constraint('>', '1.0')
    require_end = Constraint('<', '1.2')
    provider = Constraint('==', '1.1')

    multi = MultiConstraint((require_start, require_end))

    assert multi.matches(provider)
def test_multi_version_provided_match_succeeds():
    require_start = Constraint('>', '1.0')
    require_end = Constraint('<', '1.2')
    provide_start = Constraint('>=', '1.1')
    provide_end = Constraint('<', '2.0')

    multi_require = MultiConstraint((require_start, require_end))
    multi_provide = MultiConstraint((provide_start, provide_end))

    assert multi_require.matches(multi_provide)
Example #4
0
def test_parse_constraints_tilde(parser, input, min, max):
    if min:
        expected = MultiConstraint((min, max))
    else:
        expected = max

    assert str(parser.parse_constraints(input)) == str(expected)
Example #5
0
def test_parse_constraints_negative_wildcard(parser, input, min, max):
    if min:
        expected = MultiConstraint((min, max), conjunctive=False)
    else:
        expected = max

    constraint = parser.parse_constraints(input)
    assert str(constraint.constraint) == str(expected)
Example #6
0
def test_parse_constraints_multi(parser, input):
    first = Constraint('>', '2.0.0.0')
    second = Constraint('<=', '3.0.0.0')
    multi = MultiConstraint((first, second))

    assert str(parser.parse_constraints(input)) == str(multi)