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
894f9171
Commit
894f9171
authored
Mar 11, 2013
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1647 from MITx/fix/zoldak/pep8-cleanup-tests
Fix modulestore tests for pep8 violations
parents
d85f7ac9
1c98d5fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
common/lib/xmodule/xmodule/modulestore/tests/factories.py
+4
-4
common/lib/xmodule/xmodule/modulestore/tests/test_location.py
+11
-11
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py
+2
-2
No files found.
common/lib/xmodule/xmodule/modulestore/tests/factories.py
View file @
894f9171
...
...
@@ -46,10 +46,10 @@ class XModuleCourseFactory(Factory):
new_course
.
metadata
[
'start'
]
=
stringify_time
(
gmtime
())
new_course
.
tabs
=
[{
"type"
:
"courseware"
},
{
"type"
:
"course_info"
,
"name"
:
"Course Info"
},
{
"type"
:
"discussion"
,
"name"
:
"Discussion"
},
{
"type"
:
"wiki"
,
"name"
:
"Wiki"
},
{
"type"
:
"progress"
,
"name"
:
"Progress"
}]
{
"type"
:
"course_info"
,
"name"
:
"Course Info"
},
{
"type"
:
"discussion"
,
"name"
:
"Discussion"
},
{
"type"
:
"wiki"
,
"name"
:
"Wiki"
},
{
"type"
:
"progress"
,
"name"
:
"Progress"
}]
# Update the data in the mongo datastore
store
.
update_metadata
(
new_course
.
location
.
url
(),
new_course
.
own_metadata
)
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_location.py
View file @
894f9171
...
...
@@ -119,11 +119,11 @@ def test_equality():
# All the cleaning functions should do the same thing with these
general_pairs
=
[(
''
,
''
),
(
' '
,
'_'
),
(
'abc,'
,
'abc_'
),
(
'ab fg!@//
\\
aj'
,
'ab_fg_aj'
),
(
u"ab
\xA9
"
,
"ab_"
),
# no unicode allowed for now
]
(
' '
,
'_'
),
(
'abc,'
,
'abc_'
),
(
'ab fg!@//
\\
aj'
,
'ab_fg_aj'
),
(
u"ab
\xA9
"
,
"ab_"
),
# no unicode allowed for now
]
def
test_clean
():
...
...
@@ -131,7 +131,7 @@ def test_clean():
(
'a:b'
,
'a_b'
),
# no colons in non-name components
(
'a-b'
,
'a-b'
),
# dashes ok
(
'a.b'
,
'a.b'
),
# dot ok
]
]
for
input
,
output
in
pairs
:
assert_equals
(
Location
.
clean
(
input
),
output
)
...
...
@@ -141,17 +141,17 @@ def test_clean_for_url_name():
(
'a:b'
,
'a:b'
),
# colons ok in names
(
'a-b'
,
'a-b'
),
# dashes ok in names
(
'a.b'
,
'a.b'
),
# dot ok in names
]
]
for
input
,
output
in
pairs
:
assert_equals
(
Location
.
clean_for_url_name
(
input
),
output
)
def
test_clean_for_html
():
pairs
=
general_pairs
+
[
(
"a:b"
,
"a_b"
),
# no colons for html use
(
"a-b"
,
"a-b"
),
# dashes ok (though need to be replaced in various use locations. ugh.)
(
'a.b'
,
'a_b'
),
# no dots.
]
(
"a:b"
,
"a_b"
),
# no colons for html use
(
"a-b"
,
"a-b"
),
# dashes ok (though need to be replaced in various use locations. ugh.)
(
'a.b'
,
'a_b'
),
# no dots.
]
for
input
,
output
in
pairs
:
assert_equals
(
Location
.
clean_for_html
(
input
),
output
)
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py
View file @
894f9171
...
...
@@ -12,7 +12,7 @@ def check_path_to_location(modulestore):
(
"edX/toy/2012_Fall"
,
"Overview"
,
"Welcome"
,
None
)),
(
"i4x://edX/toy/chapter/Overview"
,
(
"edX/toy/2012_Fall"
,
"Overview"
,
None
,
None
)),
)
)
course_id
=
"edX/toy/2012_Fall"
for
location
,
expected
in
should_work
:
...
...
@@ -20,6 +20,6 @@ def check_path_to_location(modulestore):
not_found
=
(
"i4x://edX/toy/video/WelcomeX"
,
"i4x://edX/toy/course/NotHome"
)
)
for
location
in
not_found
:
assert_raises
(
ItemNotFoundError
,
path_to_location
,
modulestore
,
course_id
,
location
)
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