Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get 100% of Python 3.4 tests to pass.
- Loading branch information
Showing
14 changed files
with
113 additions
and
48 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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*.log | ||
*.log.* | ||
*.pid | ||
*.sublime-* | ||
celerybeat-schedule | ||
coverage.xml | ||
loadtest/src/*.json | ||
|
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ language: python | |
python: | ||
- "2.6" | ||
- "2.7" | ||
- "3.4" | ||
|
||
notifications: | ||
email: | ||
|
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
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,35 @@ | ||
from datetime import datetime | ||
|
||
from pytz import UTC | ||
|
||
from ichnaea.tests.base import TestCase | ||
from ichnaea import util | ||
|
||
|
||
class TestUtil(TestCase): | ||
|
||
gzip_foo = (b'\x1f\x8b\x08\x00\xed\x7f\x9aU\x02\xffK' | ||
b'\xcb\xcf\x07\x00!es\x8c\x03\x00\x00\x00') | ||
|
||
def test_utcnow(self): | ||
now = util.utcnow() | ||
self.assertTrue(isinstance(now, datetime)) | ||
self.assertEqual(now.tzinfo, UTC) | ||
|
||
def test_encode_gzip(self): | ||
data = util.encode_gzip(u'foo') | ||
self.assertEqual(data[:4], self.gzip_foo[:4]) | ||
self.assertEqual(data[-13:], self.gzip_foo[-13:]) | ||
|
||
def test_encode_gzip_bytes(self): | ||
data = util.encode_gzip(b'foo') | ||
self.assertEqual(data[:4], self.gzip_foo[:4]) | ||
self.assertEqual(data[-13:], self.gzip_foo[-13:]) | ||
|
||
def test_decode_gzip(self): | ||
data = util.decode_gzip(self.gzip_foo) | ||
self.assertEqual(data, u'foo') | ||
|
||
def test_roundtrip_gzip(self): | ||
data = util.decode_gzip(util.encode_gzip(b'foo')) | ||
self.assertEqual(data, u'foo') |
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