-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* python3: Added basic tests for charset_from_headers(). Always re-create the build dir between nose runs. Don't use nose's with-id plugin anymore. Updated tests to work correctly with Python 2 or 3. Added py3{1,2} to default tox environment list. Force build/lib in to sys.path for running tests. Decode HTTP response using Content-Type header's value. Switched to using entry points for github_manage_collaborators. Use 2to3 when running setup with Python 3.
- Loading branch information
Showing
8 changed files
with
64 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sys | ||
|
||
from nose.tools import assert_equals | ||
|
||
# Forcibly insert path for `setup.py build` output, so that we import from the | ||
# ``2to3`` converted sources | ||
sys.path.insert(0, 'build/lib') | ||
|
||
from github2.request import charset_from_headers | ||
|
||
|
||
def no_match_test(): | ||
d = {} | ||
assert_equals("ascii", charset_from_headers(d)) | ||
|
||
def utf_test(): | ||
d = {'content-type': 'application/json; charset=utf-8'} | ||
assert_equals("utf-8", charset_from_headers(d)) |
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