def test_validate_legacy_dist_req_invalid(self, monkeypatch, requirement):
        spec_validator = pretend.call_recorder(lambda spec: None)
        monkeypatch.setattr(pypi, "_validate_pep440_specifier", spec_validator)

        with pytest.raises(ValidationError):
            pypi._validate_legacy_dist_req(requirement)

        assert spec_validator.calls == []
Exemple #2
0
    def test_validate_legacy_dist_req_invalid(self, monkeypatch, requirement):
        spec_validator = pretend.call_recorder(lambda spec: None)
        monkeypatch.setattr(pypi, "_validate_pep440_specifier", spec_validator)

        with pytest.raises(ValidationError):
            pypi._validate_legacy_dist_req(requirement)

        assert spec_validator.calls == []
    def test_validate_legacy_dist_req_valid(self, monkeypatch, requirement,
                                            specifier):
        spec_validator = pretend.call_recorder(lambda spec: None)
        monkeypatch.setattr(pypi, "_validate_pep440_specifier", spec_validator)
        pypi._validate_legacy_dist_req(requirement)

        if specifier is not None:
            assert spec_validator.calls == [pretend.call(specifier)]
        else:
            assert spec_validator.calls == []
Exemple #4
0
    def test_validate_legacy_dist_req_valid(self, monkeypatch, requirement,
                                            specifier):
        spec_validator = pretend.call_recorder(lambda spec: None)
        monkeypatch.setattr(pypi, "_validate_pep440_specifier", spec_validator)
        pypi._validate_legacy_dist_req(requirement)

        if specifier is not None:
            assert spec_validator.calls == [pretend.call(specifier)]
        else:
            assert spec_validator.calls == []