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
7da8eb1f
Commit
7da8eb1f
authored
Jun 09, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delay constructing the set of mongo calls until they're needed
parent
984eb0a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
common/lib/xmodule/xmodule/modulestore/tests/factories.py
+5
-5
No files found.
common/lib/xmodule/xmodule/modulestore/tests/factories.py
View file @
7da8eb1f
...
...
@@ -330,18 +330,18 @@ def check_sum_of_calls(object_, methods, maximum_calls, minimum_calls=1):
yield
call_count
=
sum
(
mock
.
call_count
for
mock
in
mocks
.
values
())
calls
=
pprint
.
pformat
({
method_name
:
mock
.
call_args_list
for
method_name
,
mock
in
mocks
.
items
()
})
# Assertion errors don't handle multi-line values, so pretty-print to std-out instead
if
not
minimum_calls
<=
call_count
<=
maximum_calls
:
calls
=
{
method_name
:
mock
.
call_args_list
for
method_name
,
mock
in
mocks
.
items
()
}
print
"Expected between {} and {} calls, {} were made. Calls: {}"
.
format
(
minimum_calls
,
maximum_calls
,
call_count
,
calls
,
pprint
.
pformat
(
calls
)
,
)
# verify the counter actually worked by ensuring we have counted greater than (or equal to) the minimum calls
...
...
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