本文整理汇总了Python中opaque_keys.edx.locator.BlockUsageLocator.map_into_course方法的典型用法代码示例。如果您正苦于以下问题:Python BlockUsageLocator.map_into_course方法的具体用法?Python BlockUsageLocator.map_into_course怎么用?Python BlockUsageLocator.map_into_course使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opaque_keys.edx.locator.BlockUsageLocator
的用法示例。
在下文中一共展示了BlockUsageLocator.map_into_course方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_map_into_course_location
# 需要导入模块: from opaque_keys.edx.locator import BlockUsageLocator [as 别名]
# 或者: from opaque_keys.edx.locator.BlockUsageLocator import map_into_course [as 别名]
def test_map_into_course_location(self, deprecated_source, deprecated_dest):
original_course = CourseLocator('org', 'course', 'run', deprecated=deprecated_source)
new_course = CourseLocator('edX', 'toy', '2012_Fall', deprecated=deprecated_dest)
loc = BlockUsageLocator(original_course, 'cat', 'name:more_name', deprecated=deprecated_source)
expected = BlockUsageLocator(new_course, 'cat', 'name:more_name', deprecated=deprecated_dest)
actual = loc.map_into_course(new_course)
self.assertEqual(expected, actual)
示例2: test_map_into_course_location
# 需要导入模块: from opaque_keys.edx.locator import BlockUsageLocator [as 别名]
# 或者: from opaque_keys.edx.locator.BlockUsageLocator import map_into_course [as 别名]
def test_map_into_course_location(self):
original_course = CourseKey.from_string('org/course/run')
new_course = CourseKey.from_string('edX/toy/2012_Fall')
loc = BlockUsageLocator(original_course, 'cat', 'name:more_name', deprecated=True)
self.assertEquals(
BlockUsageLocator(new_course, 'cat', 'name:more_name', deprecated=True),
loc.map_into_course(new_course)
)