def test_to_pinned_versions_trivial(): assert main.to_pinned_versions(()) == {}
def test_to_pinned_versions(): pinned_versions = main.to_pinned_versions(( (pkg_resources.Requirement.parse('foo==2'), 'reqs.txt'), (pkg_resources.Requirement.parse('bar==3'), 'reqs.txt'), )) assert pinned_versions == {'foo': '2', 'bar': '3'}
def test_to_pinned_versions_uses_key(): pinned_versions = main.to_pinned_versions( ((pkg_resources.Requirement.parse('Foo==2'), 'reqs.txt'), )) assert pinned_versions == {'foo': '2'}