Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
f08dc428
Commit
f08dc428
authored
11 years ago
by
David Baumgold
Browse files
Options
Downloads
Patches
Plain Diff
Add some dummy arg parsing tests
parent
bbec6266
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
+33
-0
33 additions, 0 deletions
...tstore/management/commands/tests/test_migrate_to_split.py
with
33 additions
and
0 deletions
cms/djangoapps/contentstore/management/commands/tests/test_migrate_to_split.py
0 → 100644
+
33
−
0
View file @
f08dc428
"""
Unittests for importing a course via management command
"""
import
unittest
from
django.core.management
import
CommandError
from
contentstore.management.commands.migrate_to_split
import
Command
class
TestArgParsing
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
command
=
Command
()
def
test_no_args
(
self
):
errstring
=
"
migrate_to_split requires at least two arguments
"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
()
def
test_invalid_location
(
self
):
errstring
=
"
Invalid location string
"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"
foo
"
,
"
bar
"
)
def
test_nonexistant_user_id
(
self
):
errstring
=
"
No user exists with ID 99
"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"
i4x://org/course/category/name
"
,
"
99
"
)
def
test_nonexistant_user_email
(
self
):
errstring
=
"
No user exists with email fake@example.com
"
with
self
.
assertRaisesRegexp
(
CommandError
,
errstring
):
self
.
command
.
handle
(
"
i4x://org/course/category/name
"
,
"
fake@example.com
"
)
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