Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__pycache__/
build/
tests/cli.toml
pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing
GPG-PRIVATE-KEY-fixture-signing
site/
dist/
*.po~
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lint:
ruff check --diff
.ci/scripts/check_cli_dependencies.py
.ci/scripts/check_click_for_mypy.py
MYPYPATH=pulp-glue-deb mypy
mypy
cd pulp-glue-deb; mypy
@echo "🙊 Code 🙈 LGTM 🙉 !"

Expand Down
2 changes: 1 addition & 1 deletion lint_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lint requirements
ruff~=0.15.0
ruff~=0.15.1
mypy~=1.19.1
shellcheck-py~=0.11.0.1

Expand Down
1 change: 1 addition & 0 deletions pulp-glue-deb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ strict = true
warn_unused_ignores = false
show_error_codes = true
files = "pulp_glue/**/*.py, tests/**/*.py"
mypy_path = ["."]
namespace_packages = true
explicit_package_bases = true

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespaces = true
# This section is co-managed by the cookiecutter templates.
# Changes to existing keys should be preserved.
app_label = "deb"
src_layout = false
repository = "https://github.com/pulp/pulp-cli-deb"
glue = true
docs = false
Expand Down Expand Up @@ -128,6 +129,7 @@ strict = true
warn_unused_ignores = false
show_error_codes = true
files = "pulpcore/**/*.py, tests/*.py"
mypy_path = [".", "pulp-glue-deb"]
namespace_packages = true
explicit_package_bases = true

Expand Down Expand Up @@ -205,4 +207,3 @@ extend-select = ["I"]
sections = { second-party = ["pulp_glue"] }
section-order = ["future", "standard-library", "third-party", "second-party", "first-party", "local-folder"]


41 changes: 38 additions & 3 deletions tests/scripts/config.source
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Library for test helper functions

: "${PULP_API_ROOT:="/pulp/"}"

# open fd 3 as a copy of stderr
exec 3<&2

Expand Down Expand Up @@ -46,10 +48,43 @@ expect_fail () {
fi
}

# Expects the provided test to pass
# Supresses all output, which is redirected to ASSERTION_OUTPUT and ASSERTION_ERROUTPUT so as not
# to overwrite the latest OUTPUT and ERROUTPUT, that way we can test several assertions in a row.
# Expects the command to report access denied
# Supresses all output, which is redirected to $OUTPUT and $ERROUTPUT
# Reports verbosely on failure
expect_deny () {
if {
"$@"
} 1>log.out 2>log.err
# TODO check for access denied message
then
echo "FAILURE [! $@]" >&3
echo "=== STDOUT ===" >&3
cat log.out >&3
echo "=== STDERR ===" >&3
cat log.err >&3
false
else
if grep -q "Operation .* not authorized." log.err
then
echo "SUCCESS [! $@]" >&3
OUTPUT="$(cat log.out)"
ERROUTPUT="$(cat log.err)"
else
echo "FAILURE [! $@]" >&3
echo "=== STDOUT ===" >&3
cat log.out >&3
echo "=== STDERR ===" >&3
cat log.err >&3
false
fi
fi
}

# Expects the provided test to pass
# Supresses all output, which is redirected to ASSERTION_OUTPUT and
# ASSERTION_ERROUTPUT so as not to overwrite the latest OUTPUT and ERROUTPUT.
# That way we can test several assertions in a row.
# Reports verbosely on failure.
assert () {
if {
[[ "$@" ]]
Expand Down
Loading