Skip to content

Commit

Permalink
Run 2to3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zulqarnain committed Jun 26, 2020
1 parent 99dade9 commit 807b2ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions ccx_keys/locator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
""" Locator module. """
from __future__ import unicode_literals

import re

from opaque_keys import InvalidKeyError
Expand Down Expand Up @@ -93,7 +91,7 @@ def _to_string(self):
"""
string = super(CCXLocator, self)._to_string()
# append the identifier for the ccx to the existing course string
string += u"+{prefix}@{ccx}".format(
string += "+{prefix}@{ccx}".format(
prefix=self.CCX_PREFIX, ccx=self.ccx
)
return string
Expand Down
13 changes: 6 additions & 7 deletions ccx_keys/tests/test_ccx_keys.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" Tests for the ccx_keys package. """

import six
import ddt
import itertools # pylint: disable=wrong-import-order
Expand Down Expand Up @@ -137,7 +136,7 @@ def test_missing_ccx_id(self, fields):
'branch': 'draft-1',
}
use_fields = dict(
(k, v) for k, v in available_fields.items() if k in fields
(k, v) for k, v in list(available_fields.items()) if k in fields
)
with self.assertRaises(InvalidKeyError) as context_manager:
CCXLocator(**use_fields)
Expand Down Expand Up @@ -184,7 +183,7 @@ def test_locator_from_good_url(self, fields, url_template):
this_url = url_template.format(**available_fields)
testobj = CourseKey.from_string(this_url)
use_keys = dict(
(k, v) for k, v in available_fields.items() if k in fields
(k, v) for k, v in list(available_fields.items()) if k in fields
)

if 'version_guid' in use_keys:
Expand Down Expand Up @@ -236,7 +235,7 @@ def test_from_course_locator_constructor(self, fields):
'branch': 'draft-1',
}
ccx = '1'
use_fields = dict((k, v) for k, v in available_fields.items() if k in fields)
use_fields = dict((k, v) for k, v in list(available_fields.items()) if k in fields)
course_id = CourseLocator(**use_fields)
testobj = CCXLocator.from_course_locator(course_id, ccx)

Expand Down Expand Up @@ -329,8 +328,8 @@ def test_valid_locations(self, org, course, run, ccx, category, name, revision):
(["foo", "bar", "baz", "blat:blat", "foo:bar"], {}), # ':' ok in name, not in category
(('org', 'course', 'run', 'category', 'name with spaces', 'revision'), {}),
(('org', 'course', 'run', 'category', 'name/with/slashes', 'revision'), {}),
(('org', 'course', 'run', 'category', 'name', u'\xae'), {}),
(('org', 'course', 'run', 'category', u'\xae', 'revision'), {}),
(('org', 'course', 'run', 'category', 'name', '\xae'), {}),
(('org', 'course', 'run', 'category', '\xae', 'revision'), {}),
((), {
'tag': 'tag',
'course': 'course',
Expand Down Expand Up @@ -371,7 +370,7 @@ def test_replacement(self, key, newvalue):
)

with self.assertRaises(InvalidKeyError):
CCXBlockUsageLocator(course_key, 'c', 'n', deprecated=True).replace(block_id=u'name\xae')
CCXBlockUsageLocator(course_key, 'c', 'n', deprecated=True).replace(block_id='name\xae')

def test_map_into_course_location(self):
original_course = CCXLocator(org='org', course='course', run='run', ccx='1')
Expand Down

0 comments on commit 807b2ae

Please sign in to comment.