refactor: rename ModuleStore runtimes now that XModules are gone (#35523)
* Consolidates and renames the runtime used as a base for all the others:
* Before: `xmodule.x_module:DescriptorSystem` and
`xmodule.mako_block:MakoDescriptorSystem`.
* After: `xmodule.x_module:ModuleStoreRuntime`.
* Co-locates and renames the runtimes for importing course OLX:
* Before: `xmodule.x_module:XMLParsingSystem` and
`xmodule.modulestore.xml:ImportSystem`.
* After: `xmodule.modulestore.xml:XMLParsingModuleStoreRuntime` and
`xmodule.modulestore.xml:XMLImportingModuleStoreRuntime`.
* Note: I would have liked to consolidate these, but it would have
involved nontrivial test refactoring.
* Renames the stub Old Mongo runtime:
* Before: `xmodule.modulestore.mongo.base:CachingDescriptorSystem`.
* After: `xmodule.modulestore.mongo.base:OldModuleStoreRuntime`.
* Renames the Split Mongo runtime, the which is what runs courses in LMS and CMS:
* Before: `xmodule.modulestore.split_mongo.caching_descriptor_system:CachingDescriptorSystem`.
* After: `xmodule.modulestore.split_mongo.runtime:SplitModuleStoreRuntime`.
* Renames some of the dummy runtimes used only in unit tests.
This commit is contained in:
@@ -11,14 +11,13 @@ from lxml import etree
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
from xblock.runtime import DictKeyValueStore, KvsFieldData
|
||||
|
||||
from xmodule.mako_block import MakoDescriptorSystem
|
||||
from xmodule.modulestore.xml import CourseLocationManager
|
||||
from xmodule.x_module import XMLParsingSystem, policy_key
|
||||
from xmodule.modulestore.xml import XMLParsingModuleStoreRuntime, CourseLocationManager
|
||||
from xmodule.x_module import policy_key
|
||||
|
||||
|
||||
class InMemorySystem(XMLParsingSystem, MakoDescriptorSystem): # pylint: disable=abstract-method
|
||||
class InMemoryModuleStoreRuntime(XMLParsingModuleStoreRuntime): # pylint: disable=abstract-method
|
||||
"""
|
||||
The simplest possible XMLParsingSystem
|
||||
The simplest possible ModuleStoreRuntime
|
||||
"""
|
||||
def __init__(self, xml_import_data):
|
||||
self.course_id = CourseKey.from_string(xml_import_data.course_id)
|
||||
@@ -63,5 +62,5 @@ class XModuleXmlImportTest(TestCase):
|
||||
@classmethod
|
||||
def process_xml(cls, xml_import_data):
|
||||
"""Use the `xml_import_data` to import an :class:`XBlock` from XML."""
|
||||
system = InMemorySystem(xml_import_data)
|
||||
system = InMemoryModuleStoreRuntime(xml_import_data)
|
||||
return system.process_xml(xml_import_data.xml_string)
|
||||
|
||||
Reference in New Issue
Block a user