-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from edx/jenkins/cleanup-python-code-de897e3
Python Code Cleanup
- Loading branch information
Showing
14 changed files
with
88 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Tests for `user_util` package.""" | ||
|
||
|
@@ -100,7 +99,7 @@ def test_username_to_hash_is_normalized(salt_list): | |
|
||
|
||
def test_unicode_username_to_hash(): | ||
username = u'ÁĹéáŕńéŕŰśéŕŃáḿéẂíthŰńíćődé' | ||
username = 'ÁĹéáŕńéŕŰśéŕŃáḿéẂíthŰńíćődé' | ||
retired_username = user_util.get_retired_username(username, VALID_SALT_LIST_ONE_SALT) | ||
assert retired_username != username | ||
# Since SHA1 is used, the hexadecimal digest length should be 40. | ||
|
@@ -168,7 +167,7 @@ def test_email_to_hash_is_normalized(salt_list): | |
|
||
|
||
def test_unicode_email_to_hash(): | ||
email = u'🅐.🅛🅔🅐🅡🅝🅔🅡[email protected]' | ||
email = '🅐.🅛🅔🅐🅡🅝🅔🅡[email protected]' | ||
retired_email = user_util.get_retired_email(email, VALID_SALT_LIST_ONE_SALT) | ||
assert retired_email != email | ||
# Since SHA1 is used, the hexadecimal digest length should be 40. | ||
|
@@ -237,7 +236,7 @@ def test_external_key_to_hash(salt_list): | |
|
||
|
||
def test_unicode_external_key_to_hash(): | ||
unicode_external_key = u'🅐.🅛🅔🅐🅡🅝🅔🅡' | ||
unicode_external_key = '🅐.🅛🅔🅐🅡🅝🅔🅡' | ||
retired_external_key= user_util.get_retired_external_key(unicode_external_key, VALID_SALT_LIST_ONE_SALT) | ||
assert retired_external_key != unicode_external_key | ||
# Since SHA1 is used, the hexadecimal digest length should be 40. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
[tox] | ||
envlist = py{35}-django{22},py{38}-django{22,30},quality | ||
envlist = py38-django{22,30,31},quality | ||
|
||
[travis] | ||
python = | ||
3.5: py35 | ||
3.8: py38 | ||
quality: flake8 | ||
python = | ||
3.8: py38 | ||
quality: flake8 | ||
|
||
[testenv:quality] | ||
basepython = python | ||
deps = flake8 | ||
commands = flake8 user_util | ||
|
||
[testenv] | ||
setenv = | ||
PYTHONPATH = {toxinidir} | ||
deps = | ||
-r requirements/test.txt | ||
commands = | ||
pip install -U pip | ||
python setup.py develop | ||
py.test --basetemp={envtmpdir} | ||
setenv = | ||
PYTHONPATH = {toxinidir} | ||
deps = | ||
-r requirements/test.txt | ||
commands = | ||
pip install -U pip | ||
python setup.py develop | ||
py.test --basetemp={envtmpdir} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Top-level package for Open edX User Utilities.""" | ||
|
||
__version__ = '0.3.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Main module.""" | ||
import hashlib | ||
|
||
|