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

Add HEAD authorization tests #670

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonashaag
Copy link

I'd like to make sure that HEAD requests respond with 40x iff the corresponding GET requests respond with 40x.

I didn't find any tests for the actual package URLs. I'd like to add tests for those URLs as well.

@@ -439,20 +439,23 @@ def test_private_channels_download(db, client, data, channel_dirs):
assert response.text == "file content 0"

# fail on private channel without credentials
response = client.get('/get/privatechannel/noarch/current_repodata.json')
assert response.status_code == 401
for method in [client.get, client.head]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jonashaag, what would speak against adding a method callable as a parametrization instead of adding an iteration on each assertion?

Copy link
Author

Choose a reason for hiding this comment

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

That was my first approach. The problem is that you need this in very few places only

Copy link
Collaborator

Choose a reason for hiding this comment

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

Now I see it. 🙈

@wolfv wolfv added the enhancement New feature or request label Nov 22, 2023
@wolfv
Copy link
Member

wolfv commented Nov 22, 2023

Looks good to me, but I assume we're waiting for some more tests @jonashaag ?

@jonashaag
Copy link
Author

Are there any tests for package downloads? I haven't found them. I'd like to add the same there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants