diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-05-05 20:42:45 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-05-05 20:42:45 +0300 |
commit | f7b90deb8bfc441c98e74e896abeedd967fadd1c (patch) | |
tree | 2359976333f4b57c511442c9578ea3268d755d71 /tests | |
parent | pkgdev manifest: add --if-modified (diff) | |
download | pkgdev-f7b90deb8bfc441c98e74e896abeedd967fadd1c.tar.gz pkgdev-f7b90deb8bfc441c98e74e896abeedd967fadd1c.tar.bz2 pkgdev-f7b90deb8bfc441c98e74e896abeedd967fadd1c.zip |
pkgdev manifest: add --ignore-fetch-restricted
Resolves: https://github.com/pkgcore/pkgdev/issues/64
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/test_pkgdev_manifest.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/scripts/test_pkgdev_manifest.py b/tests/scripts/test_pkgdev_manifest.py index 696a2f2..5787770 100644 --- a/tests/scripts/test_pkgdev_manifest.py +++ b/tests/scripts/test_pkgdev_manifest.py @@ -1,5 +1,5 @@ from functools import partial -from typing import Set +from typing import List, Set from unittest.mock import patch import pytest @@ -94,6 +94,28 @@ class TestPkgdevManifestParseArgs: git_repo.remove(ebuild_path, commit=False) assert manifest_matches() == set() + def test_ignore_fetch_restricted(self, repo, tool): + def manifest_matches() -> List[str]: + with chdir(repo.location): + options, _ = tool.parse_args(['manifest', '--ignore-fetch-restricted']) + return [x.cpvstr for x in repo.itermatch(options.restriction)] + + # No RESTRICT + repo.create_ebuild('cat/pkg-0') + assert manifest_matches() == ['cat/pkg-0'] + + # Not fetch RESTRICT + repo.create_ebuild('cat/pkg-0', restrict=('mirror')) + assert manifest_matches() == ['cat/pkg-0'] + + # fetch RESTRICT + repo.create_ebuild('cat/pkg-0', restrict=('fetch')) + assert manifest_matches() == [] + + # Multiple RESTRICT + repo.create_ebuild('cat/pkg-0', restrict=('mirror', 'fetch')) + assert manifest_matches() == [] + def test_non_repo_dir_target(self, tmp_path, repo, capsys, tool): with pytest.raises(SystemExit) as excinfo, \ chdir(repo.location): |