Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graph_drawing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Taddeüs Kroes
graph_drawing
Commits
db709d6c
Commit
db709d6c
authored
13 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
Added all doctests as unit tests.
parent
4f3552b4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_graph.py
+5
-0
5 additions, 0 deletions
tests/test_graph.py
tests/test_line.py
+5
-0
5 additions, 0 deletions
tests/test_line.py
tests/test_node.py
+5
-0
5 additions, 0 deletions
tests/test_node.py
with
15 additions
and
0 deletions
tests/test_graph.py
+
5
−
0
View file @
db709d6c
# vim: set fileencoding=utf-8 :
import
unittest
import
doctest
import
graph
from
node
import
Node
,
Leaf
from
graph
import
generate_graph
class
TestGraph
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
graph
)[
0
],
0
)
def
setUp
(
self
):
self
.
l0
,
self
.
l1
,
self
.
multi
=
Leaf
(
0
),
Leaf
(
1
),
Leaf
(
'
test
'
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_line.py
+
5
−
0
View file @
db709d6c
import
unittest
import
doctest
import
line
from
node
import
Node
as
N
,
Leaf
as
L
from
line
import
generate_line
,
is_id
,
is_int
class
TestLine
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
line
)[
0
],
0
)
def
test_empty
(
self
):
self
.
assertEquals
(
generate_line
(
None
),
'
<empty expression>
'
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_node.py
+
5
−
0
View file @
db709d6c
import
unittest
import
doctest
import
node
from
node
import
Node
,
Leaf
class
TestNode
(
unittest
.
TestCase
):
def
test_doctest
(
self
):
self
.
assertEqual
(
doctest
.
testmod
(
m
=
node
)[
0
],
0
)
def
setUp
(
self
):
self
.
l0
=
Leaf
(
'
leaf 1
'
)
self
.
l1
=
Leaf
(
'
leaf 2
'
)
...
...
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