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

remove special code for python 2.7 (six.PY2) #3485

Merged
merged 3 commits into from Jan 27, 2023

Conversation

NNLemling
Copy link
Collaborator

@NNLemling NNLemling commented Jan 25, 2023

working on #2128.

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Merging #3485 (1a03efa) into master (3c720d6) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3485   +/-   ##
=======================================
  Coverage   95.78%   95.78%           
=======================================
  Files         170      170           
  Lines       23137    23131    -6     
=======================================
- Hits        22161    22157    -4     
+ Misses        976      974    -2     
Impacted Files Coverage Δ
privacyidea/lib/resolvers/PasswdIdResolver.py 99.14% <ø> (+0.41%) ⬆️
privacyidea/lib/smtpserver.py 93.70% <ø> (+0.62%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

if six.PY2:
expected = "The user User(login=u'cornelius@unknown', " \
"realm=u'realm1', resolver='') exists in NO resolver."
else:
expected = "The user User(login='cornelius@unknown', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the init of the line, please

like this

with self.app.test_request_context('/auth',
                                               method='POST',
                                               data={"username": "cornelius@unknown",
                                                     "realm": "realm1",
                                                     "password": "test"}):
                res = self.app.full_dispatch_request()
                self.assertEqual(401, res.status_code, res)
                result = res.json.get("result")
                self.assertFalse(result.get("status"), result)
expected = "The user User(login='cornelius@unknown', " \

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

if six.PY2:
expected = "The user User(login=u'selfservice', " \
"realm=u'realm3', resolver='') exists in NO resolver."
else:
expected = "The user User(login='selfservice', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

here also

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

if six.PY2:
expected = "The user User(login=u'cornelius@realm1', " \
"realm=u'realm1', resolver='') exists in NO resolver."
else:
expected = "The user User(login='cornelius@realm1', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

here also

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

if six.PY2:
expected = "The user User(login=u'cornelius@unknown', " \
"realm=u'realm1', resolver='') exists in NO resolver."
else:
expected = "The user User(login='cornelius@unknown', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

here also

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

if six.PY2:
expected = "The user User(login=u'selfservice@realm3', " \
"realm=u'realm1', resolver='') exists in NO resolver."
else:
expected = "The user User(login='selfservice@realm3', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

here also

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

expected = "The user User(login=u'selfservice@realm1', " \
"realm=u'realm3', resolver='') exists in NO resolver."
else:
# the realm will be split from the login name
expected = "The user User(login='selfservice@realm1', " \
Copy link
Contributor

Choose a reason for hiding this comment

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

here also

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in a1e752d.

@jona-samuel jona-samuel merged commit 56fcf89 into master Jan 27, 2023
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.

None yet

2 participants