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

Fix upload return codes #4857

Merged
merged 2 commits into from
Mar 28, 2019

Conversation

lasote
Copy link
Contributor

@lasote lasote commented Mar 28, 2019

Changelog: Bugfix: Fixed authentication management when a server returns 401 uploading a file.
Docs: omit

@lasote lasote added this to the 1.14 milestone Mar 28, 2019
@ghost ghost assigned lasote Mar 28, 2019
@ghost ghost added the stage: review label Mar 28, 2019
with six.assertRaisesRegex(self, AuthenticationException, "tururu"):
uploader.upload("fake_url", f)

def test_403_raises_unauthoirzed_exception_if_no_token(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this manages the (my point of view) weird artifactory behavior while uploading


class UploaderUnitTest(unittest.TestCase):

def test_401_raises_unauthoirzed_exception(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test a regular behavior of a 401 returned when trying to upload (bintray)

with six.assertRaisesRegex(self, AuthenticationException, "tururu"):
uploader.upload("fake_url", f, auth=auth)

def test_403_raises_forbidden_exception_if_token(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test a classic wrong token while uploading

@lasote lasote merged commit 1386465 into conan-io:develop Mar 28, 2019
@ghost ghost removed the stage: review label Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants