Skip to content

Commit

Permalink
Add a test for desired output for solver messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophia Castellarin committed Jan 8, 2020
1 parent 030feb8 commit acf3d7e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,22 @@ def test_unsat_shortest_chain_3():
assert "c=1.3.6" in str(excinfo.value)


def test_unsat_shortest_chain_4():
index = (
simple_rec(name='a', depends=['py =3.7.1']),
simple_rec(name='b', depends=['py =3.6.1']),
simple_rec(name="py_req_1", version="1.0.0"),
simple_rec(name="py_req_2", version="1.0.0"),
simple_rec(name='py', version='3.7.1', depends=['py_req_1', 'py_req_2']),
simple_rec(name='py', version='3.6.1', depends=['pr_req_1', 'py_req_2']),
)
r = Resolve(OrderedDict((prec, prec) for prec in index))
with pytest.raises(UnsatisfiableError) as excinfo:
r.install(['a', 'py=3.6.1'])
assert "a -> py=3.7.1" in str(excinfo.value)
assert "py=3.6.1" in str(excinfo.value)
assert "py=3.6.1 -> py_req_2" not in str(excinfo.value)

def test_unsat_chain():
# a -> b -> c=1.x -> d=1.x
# e -> c=2.x -> d=2.x
Expand Down

0 comments on commit acf3d7e

Please sign in to comment.