Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.18] Add basic auth to content removal test #3717

Merged
merged 1 commit into from
Aug 22, 2024
Merged
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
3 changes: 2 additions & 1 deletion pulp_rpm/tests/functional/api/test_crud_content_unit.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like self.cfg is what is used to config the bindings, so I tried using self.cfg.username and self.cfg.password. Since they are empty, I've hard-coded our default dev credentials.

Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def do_test_remove_unit(self, remote_url):
repo_content = get_content(repo.to_dict())
base_addr = self.cfg.get_host_settings()[0]["url"]

basic_auth = requests.auth.HTTPBasicAuth("admin", "password")
for content_type in repo_content.keys():
response = requests.delete(
urljoin(base_addr, repo_content[content_type][0]["pulp_href"])
urljoin(base_addr, repo_content[content_type][0]["pulp_href"]), auth=basic_auth
)
self.assertEqual(response.status_code, 405)

Expand Down
Loading