def test_requires_python_full_version_no_version(): r = models.Requires({"python_full_version": "8.19"}) with pytest.raises(AttributeError) as ctx: r.python_version assert str(ctx.value) == "python_version"
def test_requires_no_duplicate_python_version(): data = {"python_version": "8.19", "python_full_version": "8.1.9"} with pytest.raises(ValueError) as ctx: models.Requires(data) assert cerberus.errors.EXCLUDES_FIELD in ctx.value.validator._errors assert len(ctx.value.validator._errors) == 2
def test_requires_python_full_version(): r = models.Requires({"python_full_version": "8.19"}) assert r.python_full_version == "8.19"