Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
f18e0b88
Commit
f18e0b88
authored
7 years ago
by
noraiz-anwar
Browse files
Options
Downloads
Patches
Plain Diff
use library summary to fetch metadata
parent
e5b9452e
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/library_tools.py
+1
-1
1 addition, 1 deletion
common/lib/xmodule/xmodule/library_tools.py
common/lib/xmodule/xmodule/tests/test_library_tools.py
+35
-0
35 additions, 0 deletions
common/lib/xmodule/xmodule/tests/test_library_tools.py
with
36 additions
and
1 deletion
common/lib/xmodule/xmodule/library_tools.py
+
1
−
1
View file @
f18e0b88
...
...
@@ -177,5 +177,5 @@ class LibraryToolsService(object):
"""
return
[
(
lib
.
location
.
library_key
.
replace
(
version_guid
=
None
,
branch
=
None
),
lib
.
display_name
)
for
lib
in
self
.
store
.
get_libraries
()
for
lib
in
self
.
store
.
get_librar
y_summar
ies
()
]
This diff is collapsed.
Click to expand it.
common/lib/xmodule/xmodule/tests/test_library_tools.py
0 → 100644
+
35
−
0
View file @
f18e0b88
"""
Tests for library tools service.
"""
from
mock
import
patch
from
xmodule.library_tools
import
LibraryToolsService
from
xmodule.modulestore.tests.factories
import
LibraryFactory
from
xmodule.modulestore.tests.utils
import
MixedSplitTestCase
class
LibraryToolsServiceTest
(
MixedSplitTestCase
):
"""
Tests for library service.
"""
def
setUp
(
self
):
super
(
LibraryToolsServiceTest
,
self
).
setUp
()
self
.
tools
=
LibraryToolsService
(
self
.
store
)
def
test_list_available_libraries
(
self
):
"""
Test listing of libraries.
"""
_
=
LibraryFactory
.
create
(
modulestore
=
self
.
store
)
all_libraries
=
self
.
tools
.
list_available_libraries
()
self
.
assertTrue
(
all_libraries
)
self
.
assertEqual
(
len
(
all_libraries
),
1
)
@patch
(
'
xmodule.modulestore.split_mongo.split.SplitMongoModuleStore.get_library_summaries
'
)
def
test_list_available_libraries_fetch
(
self
,
mock_get_library_summaries
):
"""
Test that library list is compiled using light weight library summary objects.
"""
_
=
self
.
tools
.
list_available_libraries
()
self
.
assertTrue
(
mock_get_library_summaries
.
called
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment