Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
cdb80bb8
Commit
cdb80bb8
authored
Sep 30, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the new tests to use the new way to make XBlocks.
parent
718328e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
common/lib/xmodule/xmodule/tests/xml/__init__.py
+6
-5
No files found.
common/lib/xmodule/xmodule/tests/xml/__init__.py
View file @
cdb80bb8
...
...
@@ -4,8 +4,9 @@ Xml parsing tests for XModules
import
pprint
from
mock
import
Mock
from
xmodule.x_module
import
XMLParsingSystem
,
XModuleDescriptor
from
xmodule.x_module
import
XMLParsingSystem
from
xmodule.mako_module
import
MakoDescriptorSystem
from
xmodule.modulestore.xml
import
create_block_from_xml
class
InMemorySystem
(
XMLParsingSystem
,
MakoDescriptorSystem
):
# pylint: disable=abstract-method
...
...
@@ -28,8 +29,8 @@ class InMemorySystem(XMLParsingSystem, MakoDescriptorSystem): # pylint: disable
)
def
process_xml
(
self
,
xml
):
# pylint: disable=method-hidden
"""Parse `xml` as an X
ModuleDescriptor
, and add it to `self._descriptors`"""
descriptor
=
XModuleDescriptor
.
load
_from_xml
(
xml
,
self
,
self
.
org
,
self
.
course
,
self
.
default_class
)
"""Parse `xml` as an X
Block
, and add it to `self._descriptors`"""
descriptor
=
create_block
_from_xml
(
xml
,
self
,
self
.
org
,
self
.
course
,
self
.
default_class
)
self
.
_descriptors
[
descriptor
.
location
.
url
()]
=
descriptor
return
descriptor
...
...
@@ -39,8 +40,8 @@ class InMemorySystem(XMLParsingSystem, MakoDescriptorSystem): # pylint: disable
class
XModuleXmlImportTest
(
object
):
"""Base class for tests that use basic
`XModuleDescriptor.load_from_xml` xml
parsing"""
"""Base class for tests that use basic
XML
parsing"""
def
process_xml
(
self
,
xml_import_data
):
"""Use the `xml_import_data` to import an :class:`X
ModuleDescriptor` from xml
"""
"""Use the `xml_import_data` to import an :class:`X
Block` from XML.
"""
system
=
InMemorySystem
(
xml_import_data
)
return
system
.
process_xml
(
xml_import_data
.
xml_string
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment