diff options
author | 2022-08-25 21:22:40 +0300 | |
---|---|---|
committer | 2022-08-25 21:22:40 +0300 | |
commit | 82029ba8dd93dd42e67157d030b71a563fe37f79 (patch) | |
tree | e1bdb78e2e230ea06e564d937528e980528736ab /tests | |
parent | ci: update all workflows (diff) | |
download | pkgcore-82029ba8dd93dd42e67157d030b71a563fe37f79.tar.gz pkgcore-82029ba8dd93dd42e67157d030b71a563fe37f79.tar.bz2 pkgcore-82029ba8dd93dd42e67157d030b71a563fe37f79.zip |
ebuild: improve malformed atom message & tests
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ebuild/test_atom.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/ebuild/test_atom.py b/tests/ebuild/test_atom.py index e00bc7a7b..ceb4c4959 100644 --- a/tests/ebuild/test_atom.py +++ b/tests/ebuild/test_atom.py @@ -97,6 +97,10 @@ class TestAtom(TestRestriction): "dev-util/diffball-1*") pytest.raises(errors.MalformedAtom, self.kls, "dev-util/diffball-1.*") + pytest.raises(errors.MalformedAtom, self.kls, + "~dev-util/diffball-1*") + pytest.raises(errors.MalformedAtom, self.kls, + "~dev-util/diffball-1.*") a = self.kls("=dev-util/diffball-1.2*") self.assertMatch(a, FakePkg("dev-util/diffball-1.2")) @@ -155,11 +159,11 @@ class TestAtom(TestRestriction): self.assertMatch(a, CPV.versioned(f"{astr}-1-r1")) self.assertMatch(a, CPV.versioned(f"{astr}-1-r0")) self.assertNotMatch(a, CPV.versioned(f"{astr}-2")) - pytest.raises(errors.MalformedAtom, self.kls, "~{astr}-r1") - pytest.raises(errors.MalformedAtom, self.kls, "~{astr}-r2") + pytest.raises(errors.MalformedAtom, self.kls, f"~{astr}-1-r1") + pytest.raises(errors.MalformedAtom, self.kls, f"~{astr}-1-r2") # special case- yes -r0 effectively is None, but -r shouldn't be used # with ~ - pytest.raises(errors.MalformedAtom, self.kls, "~{astr}-r0") + pytest.raises(errors.MalformedAtom, self.kls, f"~{astr}-1-r0") @pytest.mark.parametrize(("eapi", "defaults"), ( (2, False), (3, False), @@ -261,6 +265,7 @@ class TestAtom(TestRestriction): "dev-util/foo:-1", "dev-util/foo:.1", "dev-util/foo:1@2", + "dev-util/foo[bar]:1", )) def test_slot_malformed_atom(self, atom): with pytest.raises(errors.MalformedAtom): |