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
b274c2e2
Commit
b274c2e2
authored
Feb 11, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added basic test case
--HG-- branch : pmitros-mod-template
parent
cbc02078
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
courseware/modules/__init__.py
+11
-0
courseware/tests.py
+9
-13
No files found.
courseware/modules/__init__.py
View file @
b274c2e2
...
...
@@ -34,5 +34,16 @@ for module in modx_module_list:
modx_modules
[
tag
]
=
module
.
Module
def
get_module_class
(
tag
):
''' Given an XML tag (e.g. 'video'), return
the associated module (e.g. video_module.Module).
'''
return
modx_modules
[
tag
]
def
get_module_id
(
tag
):
''' Given an XML tag (e.g. 'video'), return
the default ID for that module (e.g. 'youtube_id')
'''
return
modx_modules
[
tag
]
.
id_attribute
def
get_valid_tags
():
return
modx_modules
.
keys
()
courseware/tests.py
View file @
b274c2e2
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
import
unittest
import
courseware.modules
Replace this with more appropriate tests for your application.
"""
class
ModelsTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
pass
from
django.test
import
TestCase
def
test_get_module_class
(
self
):
vc
=
courseware
.
modules
.
get_module_class
(
'video'
)
vc_str
=
"<class 'courseware.modules.video_module.Module'>"
self
.
assertEqual
(
str
(
vc
),
vc_str
)
class
SimpleTest
(
TestCase
):
def
test_basic_addition
(
self
):
"""
Tests that 1 + 1 always equals 2.
"""
self
.
assertEqual
(
1
+
1
,
2
)
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