def test_from_pipfile_entry(self, package_name, package_info, expected_values, is_locked): """Test from pipfile entry.""" package_version = PackageVersion.from_pipfile_entry(package_name, package_info, develop=False, meta=_META) for name, value in expected_values.items(): if name == "index": if value is None: assert package_version.index is None continue assert package_version.index is not None package_version.index.name == value continue assert ( getattr(package_version, name) == value ), f"Expected value for {name} for instance does not match: {value}" assert package_version.is_locked() is is_locked
def test_from_pipfile_entry_error(self, package_name, package_info): """Test from pipfile entry error.""" with pytest.raises(UnsupportedConfiguration): PackageVersion.from_pipfile_entry(package_name, package_info, develop=False, meta=_META)