Skip to content

Commit

Permalink
Merge pull request aws#166 from pdecat/python_3.9-dev
Browse files Browse the repository at this point in the history
Add python 3.9 support
  • Loading branch information
pdecat authored Oct 12, 2020
2 parents 034f591 + a37c18d commit 917bded
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ ENV/
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# Visual Studio Code
.vscode

# User-specific stuff:
.idea
*.iml
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ python:
- "3.5"
- "3.6"
- "3.7"
- "3.8-dev" # 3.8 development branch
- "3.8"
- "3.9-dev" # 3.9 development branch
before_install:
- pip install --upgrade setuptools
- pip install pytest
Expand Down
10 changes: 7 additions & 3 deletions test/test_assertion_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

from aws_adfs import roles_assertion_extractor

try:
base64_encode = base64.encodebytes
except:
base64_encode = base64.encodestring

class TestAssertionExtractor:

Expand Down Expand Up @@ -75,7 +79,7 @@ def a_page_of_allowed_beer_roles():
</Assertion>
</samlp:Response>'''

encoded_assertion = base64.encodestring(assertion.encode('utf-8')).decode('utf-8')
encoded_assertion = base64_encode(assertion.encode('utf-8')).decode('utf-8')

return ET.fromstring(
'''
Expand Down Expand Up @@ -109,7 +113,7 @@ def a_page_with_saml_without_session_duration():
</Assertion>
</samlp:Response>'''

encoded_assertion = base64.encodestring(assertion.encode('utf-8')).decode('utf-8')
encoded_assertion = base64_encode(assertion.encode('utf-8')).decode('utf-8')

return ET.fromstring(
'''
Expand Down Expand Up @@ -146,7 +150,7 @@ def a_page_with_saml_containing_session_duration(session_duration):
</Assertion>
</samlp:Response>'''.format(session_duration)

encoded_assertion = base64.encodestring(assertion.encode('utf-8')).decode('utf-8')
encoded_assertion = base64_encode(assertion.encode('utf-8')).decode('utf-8')

return ET.fromstring(
'''
Expand Down

0 comments on commit 917bded

Please sign in to comment.