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
e66cb05c
Commit
e66cb05c
authored
Dec 04, 2014
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return empty values and log a warning instead of raising NotImplemented
exceptions for XML modulestore asset metadata methods.
parent
2341bf1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
common/lib/xmodule/xmodule/modulestore/__init__.py
+2
-1
common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py
+4
-8
common/lib/xmodule/xmodule/modulestore/xml.py
+6
-3
No files found.
common/lib/xmodule/xmodule/modulestore/__init__.py
View file @
e66cb05c
...
@@ -285,7 +285,8 @@ class ModuleStoreAssetInterface(object):
...
@@ -285,7 +285,8 @@ class ModuleStoreAssetInterface(object):
Returns the container holding a dict indexed by asset block_type whose values are a list
Returns the container holding a dict indexed by asset block_type whose values are a list
of raw metadata documents
of raw metadata documents
"""
"""
raise
NotImplementedError
()
log
.
warning
(
"_find_course_assets request of ModuleStoreAssetInterface - not implemented."
)
return
None
def
_find_course_asset
(
self
,
asset_key
):
def
_find_course_asset
(
self
,
asset_key
):
"""
"""
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py
View file @
e66cb05c
...
@@ -455,14 +455,10 @@ class TestMongoAssetMetadataStorage(unittest.TestCase):
...
@@ -455,14 +455,10 @@ class TestMongoAssetMetadataStorage(unittest.TestCase):
with
storebuilder
.
build
(
None
)
as
store
:
with
storebuilder
.
build
(
None
)
as
store
:
course_key
=
store
.
make_course_key
(
"org"
,
"course"
,
"run"
)
course_key
=
store
.
make_course_key
(
"org"
,
"course"
,
"run"
)
asset_key
=
course_key
.
make_asset_key
(
'asset'
,
'foo.jpg'
)
asset_key
=
course_key
.
make_asset_key
(
'asset'
,
'foo.jpg'
)
for
method
in
[
'find_asset_metadata'
]:
self
.
assertEquals
(
store
.
find_asset_metadata
(
asset_key
),
None
)
with
self
.
assertRaises
(
NotImplementedError
):
# pylint: disable=protected-access
getattr
(
store
,
method
)(
asset_key
)
self
.
assertEquals
(
store
.
_find_course_asset
(
asset_key
),
(
None
,
None
))
with
self
.
assertRaises
(
NotImplementedError
):
self
.
assertEquals
(
store
.
get_all_asset_metadata
(
course_key
,
'asset'
),
[])
# pylint: disable=protected-access
store
.
_find_course_asset
(
asset_key
)
with
self
.
assertRaises
(
NotImplementedError
):
store
.
get_all_asset_metadata
(
course_key
,
'asset'
)
@ddt.data
(
*
MODULESTORE_SETUPS
)
@ddt.data
(
*
MODULESTORE_SETUPS
)
def
test_copy_all_assets_same_modulestore
(
self
,
storebuilder
):
def
test_copy_all_assets_same_modulestore
(
self
,
storebuilder
):
...
...
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
e66cb05c
...
@@ -867,18 +867,21 @@ class XMLModuleStore(ModuleStoreReadBase):
...
@@ -867,18 +867,21 @@ class XMLModuleStore(ModuleStoreReadBase):
For now this is not implemented, but others should feel free to implement using the asset.json
For now this is not implemented, but others should feel free to implement using the asset.json
which export produces.
which export produces.
"""
"""
raise
NotImplementedError
()
log
.
warning
(
"_find_course_asset request of XML modulestore - not implemented."
)
return
(
None
,
None
)
def
find_asset_metadata
(
self
,
asset_key
,
**
kwargs
):
def
find_asset_metadata
(
self
,
asset_key
,
**
kwargs
):
"""
"""
For now this is not implemented, but others should feel free to implement using the asset.json
For now this is not implemented, but others should feel free to implement using the asset.json
which export produces.
which export produces.
"""
"""
raise
NotImplementedError
()
log
.
warning
(
"find_asset_metadata request of XML modulestore - not implemented."
)
return
None
def
get_all_asset_metadata
(
self
,
course_key
,
asset_type
,
start
=
0
,
maxresults
=-
1
,
sort
=
None
,
**
kwargs
):
def
get_all_asset_metadata
(
self
,
course_key
,
asset_type
,
start
=
0
,
maxresults
=-
1
,
sort
=
None
,
**
kwargs
):
"""
"""
For now this is not implemented, but others should feel free to implement using the asset.json
For now this is not implemented, but others should feel free to implement using the asset.json
which export produces.
which export produces.
"""
"""
raise
NotImplementedError
()
log
.
warning
(
"get_all_asset_metadata request of XML modulestore - not implemented."
)
return
[]
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