Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph_drawing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
graph_drawing
Commits
db709d6c
Commit
db709d6c
authored
Feb 19, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added all doctests as unit tests.
parent
4f3552b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
tests/test_graph.py
tests/test_graph.py
+5
-0
tests/test_line.py
tests/test_line.py
+5
-0
tests/test_node.py
tests/test_node.py
+5
-0
No files found.
tests/test_graph.py
View file @
db709d6c
# vim: set fileencoding=utf-8 :
# vim: set fileencoding=utf-8 :
import
unittest
import
unittest
import
doctest
import
graph
from
node
import
Node
,
Leaf
from
node
import
Node
,
Leaf
from
graph
import
generate_graph
from
graph
import
generate_graph
class
TestGraph
(
unittest
.
TestCase
):
class
TestGraph
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
graph
)[
0
],
0
)
def
setUp
(
self
):
def
setUp
(
self
):
self
.
l0
,
self
.
l1
,
self
.
multi
=
Leaf
(
0
),
Leaf
(
1
),
Leaf
(
'test'
)
self
.
l0
,
self
.
l1
,
self
.
multi
=
Leaf
(
0
),
Leaf
(
1
),
Leaf
(
'test'
)
...
...
tests/test_line.py
View file @
db709d6c
import
unittest
import
unittest
import
doctest
import
line
from
node
import
Node
as
N
,
Leaf
as
L
from
node
import
Node
as
N
,
Leaf
as
L
from
line
import
generate_line
,
is_id
,
is_int
from
line
import
generate_line
,
is_id
,
is_int
class
TestLine
(
unittest
.
TestCase
):
class
TestLine
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
line
)[
0
],
0
)
def
test_empty
(
self
):
def
test_empty
(
self
):
self
.
assertEquals
(
generate_line
(
None
),
'<empty expression>'
)
self
.
assertEquals
(
generate_line
(
None
),
'<empty expression>'
)
...
...
tests/test_node.py
View file @
db709d6c
import
unittest
import
unittest
import
doctest
import
node
from
node
import
Node
,
Leaf
from
node
import
Node
,
Leaf
class
TestNode
(
unittest
.
TestCase
):
class
TestNode
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
node
)[
0
],
0
)
def
setUp
(
self
):
def
setUp
(
self
):
self
.
l0
=
Leaf
(
'leaf 1'
)
self
.
l0
=
Leaf
(
'leaf 1'
)
self
.
l1
=
Leaf
(
'leaf 2'
)
self
.
l1
=
Leaf
(
'leaf 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