diff options
author | Aric Hagberg <aric.hagberg@gmail.com> | 2014-06-02 20:24:45 -0600 |
---|---|---|
committer | Aric Hagberg <aric.hagberg@gmail.com> | 2014-06-02 20:24:45 -0600 |
commit | 35406bfc9645bae9585c74690575dfb074c98c3c (patch) | |
tree | 38c155d2ca0aa94e535f1f335cc3725bdb4f3228 | |
parent | 60b2ef7146a65306dbc41a4942fd61bd845dca10 (diff) | |
download | networkx-35406bfc9645bae9585c74690575dfb074c98c3c.tar.gz |
Add test
-rw-r--r-- | networkx/readwrite/tests/test_pajek.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/networkx/readwrite/tests/test_pajek.py b/networkx/readwrite/tests/test_pajek.py index 18c95dbc..baac689c 100644 --- a/networkx/readwrite/tests/test_pajek.py +++ b/networkx/readwrite/tests/test_pajek.py @@ -58,22 +58,22 @@ class TestPajek(object): data = line + '\n'.join(other_lines) G = parse_pajek(data) - # def test_unicode(self): - # import io - # G = nx.Graph() - # try: # Python 3.x - # name1 = chr(2344) + chr(123) + chr(6543) - # name2 = chr(5543) + chr(1543) + chr(324) - # except ValueError: # Python 2.6+ - # name1 = unichr(2344) + unichr(123) + unichr(6543) - # name2 = unichr(5543) + unichr(1543) + unichr(324) - # G.add_edge(name1, 'Radiohead', attr_dict={'foo': name2}) - # fh = io.BytesIO() - # nx.write_pajek(G,fh) - # fh.seek(0) - # H=nx.read_pajek(fh) - # assert_equal(sorted(G.nodes()),sorted(H.nodes())) - # assert_equal( - # sorted(sorted(e) for e in G.edges()), - # sorted(sorted(e) for e in H.edges())) - # assert_equal(G.graph,H.graph) + def test_unicode(self): + import io + G = nx.Graph() + try: # Python 3.x + name1 = chr(2344) + chr(123) + chr(6543) + name2 = chr(5543) + chr(1543) + chr(324) + except ValueError: # Python 2.6+ + name1 = unichr(2344) + unichr(123) + unichr(6543) + name2 = unichr(5543) + unichr(1543) + unichr(324) + G.add_edge(name1, 'Radiohead', attr_dict={'foo': name2}) + fh = io.BytesIO() + nx.write_pajek(G,fh) + fh.seek(0) + H=nx.read_pajek(fh) + assert_equal(sorted(G.nodes()),sorted(H.nodes())) + assert_equal( + sorted(sorted(e) for e in G.edges()), + sorted(sorted(e) for e in H.edges())) + assert_equal(G.graph,H.graph) |