Skip to content

Commit

Permalink
Added support for Python 3.5
Browse files Browse the repository at this point in the history
ECOM-4016
  • Loading branch information
Clinton Blackburn authored and clintonb committed Apr 4, 2016
1 parent 03cd819 commit 6b8f035
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "2.7"
- "3.5"
install:
- make requirements
- pip install coveralls
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ requirements:
pip install -r requirements.txt

test:
coverage run -m nose
tox
23 changes: 12 additions & 11 deletions ccx_keys/tests/test_ccx_keys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Tests for the ccx_keys package. """

import ddt
import six
from bson.objectid import ObjectId
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
Expand Down Expand Up @@ -260,8 +261,8 @@ class TestCCXBlockUsageLocator(LocatorBaseTest):
"i4x://org.dept%sub-prof/course.num%section-4/category/name:12%33-44",
)
def test_string_roundtrip(self, url):
actual = unicode(UsageKey.from_string(url))
self.assertEquals(
actual = six.text_type(UsageKey.from_string(url))
self.assertEqual(
url,
actual
)
Expand All @@ -283,13 +284,13 @@ def test_missing_block_id(self, url):
def test_valid_locations(self, org, course, run, ccx, category, name, revision): # pylint: disable=unused-argument
course_key = CCXLocator(org=org, course=course, run=run, branch=revision, ccx=ccx)
locator = CCXBlockUsageLocator(course_key, block_type=category, block_id=name, )
self.assertEquals(org, locator.org)
self.assertEquals(course, locator.course)
self.assertEquals(run, locator.run)
self.assertEquals(ccx, locator.ccx)
self.assertEquals(category, locator.block_type)
self.assertEquals(name, locator.block_id)
self.assertEquals(revision, locator.branch)
self.assertEqual(org, locator.org)
self.assertEqual(course, locator.course)
self.assertEqual(run, locator.run)
self.assertEqual(ccx, locator.ccx)
self.assertEqual(category, locator.block_type)
self.assertEqual(name, locator.block_id)
self.assertEqual(revision, locator.branch)

@ddt.data(
(("foo",), {}),
Expand Down Expand Up @@ -335,7 +336,7 @@ def test_invalid_locations(self, *args, **kwargs):
def test_replacement(self, key, newvalue):
course_key = CCXLocator(org='org', course='course', run='run', branch='rev', ccx='1', deprecated=False)
kwargs = {key: newvalue}
self.assertEquals(
self.assertEqual(
getattr(CCXBlockUsageLocator(course_key, 'c', 'n', deprecated=False).replace(**kwargs), key),
newvalue
)
Expand All @@ -350,7 +351,7 @@ def test_map_into_course_location(self):
expected = CCXBlockUsageLocator(new_course, 'cat', 'name:more_name')
actual = loc.map_into_course(new_course)

self.assertEquals(expected, actual)
self.assertEqual(expected, actual)

def test_ccx_from_deprecated_string(self):
"""Verify that _from_deprecated_string raises NotImplemented"""
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='edx-ccx-keys',
version='0.1.2',
version='0.2.0',
author='edX',
author_email='[email protected]',
description='Opaque key support custom courses on edX',
Expand All @@ -16,12 +16,14 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
],
packages=[
'ccx_keys',
],
install_requires=[
'edx-opaque-keys>=0.2.1,<1.0.0',
'edx-opaque-keys>=0.3.0,<1.0.0',
'six>=1.10.0,<2.0.0'
],
entry_points={
'course_key': [
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ edx-lint>=0.4.0,<1.0.0
mock>=1.3.0,<2.0.0
nose>=1.3.7,<2.0.0
pep8>=1.7.0,<2.0.0
tox>=2.3.1,<3.0.0
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
envlist = py27,py35

[testenv]
deps =
-rtest-requirements.txt

commands =
coverage run -m nose
coverage report -m

0 comments on commit 6b8f035

Please sign in to comment.