-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from mmarkov/master
Implement changes to AGraph.clear() to handle custom attributes
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
from nose.tools import * | ||
import pygraphviz as pgv | ||
|
||
|
||
def test_del(): | ||
A = pgv.AGraph() | ||
A.add_node(1,foo='bar') | ||
# For some reasons after porting to Python 3 clear often cause infinite loop | ||
A.delete_node('1') | ||
assert_equal(len(A), 0) | ||
|
||
def test_clear_node_with_attributes(): | ||
A = pgv.AGraph() | ||
A.add_node(1,foo='bar') | ||
# For some reasons after porting to Python 3 clear often cause infinite loop | ||
A.clear() | ||
assert_equal(len(A), 0) | ||
assert_equal(A.nodes(), []) | ||
assert_equal(A.node_attr.keys(), []) |