Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
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
OpenEdx
pystache_custom
Commits
55846ad7
Commit
55846ad7
authored
Dec 16, 2011
by
Chris Jerdonek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up and removed redundant unit tests of the context module.
parent
e00931d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
30 deletions
+6
-30
tests/test_context.py
+6
-30
No files found.
tests/test_context.py
View file @
55846ad7
...
@@ -177,21 +177,21 @@ class ContextTestCase(TestCase):
...
@@ -177,21 +177,21 @@ class ContextTestCase(TestCase):
"""
"""
context
=
Context
({},
{},
{})
context
=
Context
({},
{},
{})
def
test_get__
missing_key
(
self
):
def
test_get__
key_present
(
self
):
"""
"""
Test getting a
missing
key.
Test getting a key.
"""
"""
context
=
Context
()
context
=
Context
(
{
"foo"
:
"bar"
}
)
self
.
assert
True
(
context
.
get
(
"foo"
)
is
None
)
self
.
assert
Equals
(
context
.
get
(
"foo"
),
"bar"
)
def
test_get__
dictionary_methods_not_queried
(
self
):
def
test_get__
key_missing
(
self
):
"""
"""
Test getting a missing key.
Test getting a missing key.
"""
"""
context
=
Context
()
context
=
Context
()
#self.assertEquals(context.get("keys"), 2
)
self
.
assertTrue
(
context
.
get
(
"foo"
)
is
None
)
def
test_get__default
(
self
):
def
test_get__default
(
self
):
"""
"""
...
@@ -201,14 +201,6 @@ class ContextTestCase(TestCase):
...
@@ -201,14 +201,6 @@ class ContextTestCase(TestCase):
context
=
Context
()
context
=
Context
()
self
.
assertEquals
(
context
.
get
(
"foo"
,
"bar"
),
"bar"
)
self
.
assertEquals
(
context
.
get
(
"foo"
,
"bar"
),
"bar"
)
def
test_get__key_present
(
self
):
"""
Test get() with a key that is present.
"""
context
=
Context
({
"foo"
:
"bar"
})
self
.
assertEquals
(
context
.
get
(
"foo"
),
"bar"
)
def
test_get__precedence
(
self
):
def
test_get__precedence
(
self
):
"""
"""
Test that get() respects the order of precedence (later items first).
Test that get() respects the order of precedence (later items first).
...
@@ -225,19 +217,3 @@ class ContextTestCase(TestCase):
...
@@ -225,19 +217,3 @@ class ContextTestCase(TestCase):
context
=
Context
({
"fuzz"
:
"buzz"
},
{
"foo"
:
"bar"
})
context
=
Context
({
"fuzz"
:
"buzz"
},
{
"foo"
:
"bar"
})
self
.
assertEquals
(
context
.
get
(
"fuzz"
),
"buzz"
)
self
.
assertEquals
(
context
.
get
(
"fuzz"
),
"buzz"
)
def
test_get__object_attribute
(
self
):
"""
Test that object attributes are queried.
"""
context
=
Context
(
SimpleObject
())
self
.
assertEquals
(
context
.
get
(
"foo"
),
"bar"
)
def
test_get__object_callable
(
self
):
"""
Test that object callables are queried.
"""
context
=
Context
(
SimpleObject
())
#self.assertEquals(context.get("foo_callable"), "called...")
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