~ubuntu-branches/ubuntu/precise/python-networkx/precise

« back to all changes in this revision

Viewing changes to networkx/readwrite/tests/nx_yaml.txt

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-02-26 00:20:57 UTC
  • mfrom: (1.3.1 upstream) (5.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20100226002057-c4s3jshtx2o36wtx
Tags: 1.0.1-1
* New upstream release; thanks to Yaroslav Halchenko for the report;
  Closes: #565319
* debian/control
  - take maintainership back under DPMT umbrella; thanks to Cyril Brulebois
    for his work
  - adjust Vcs-{Svn, Browser} to point to DPMT location
  - bump Standards-Version to 3.8.4
    + added debian/README.source
  - replace b-d-i on python-all-dev with python only
  - use HTTP (and not HTTPS) for Homepage field
  - rephrased short description; thanks to Rogério Brito for the report;
    Closes: #557895
* debian/pyversions
  - minimum version set to 2.5
* debian/copyright
  - updated upstream copyright authors and license information
  - update copyright notice for packaging
* debian/watch
  - updated to report numerical (with dots) releases
* debian/patches/20_fix_broken_svn_keyboards
  - removed, fixed upstream
* debian/patches/20_example_dirs_remove
  - don't created empty dirs for examples no more present

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
>>> from networkx import *
2
 
>>> from networkx.operators import *
3
 
>>> import os,tempfile
4
 
 
5
 
>>> G=Graph(name="test")
6
 
>>> e=[('a','b'),('b','c'),('c','d'),('d','e'),('e','f'),('a','f')]
7
 
>>> G.add_edges_from(e)
8
 
>>> G.add_node('g')
9
 
>>> DG=DiGraph(G)
10
 
>>> XG=MultiGraph()
11
 
>>> XG.add_edges_from([(1,2,5),(1,2,5),(1,2),(3,3,42)])
12
 
 
13
 
 
14
 
YAML
15
 
----
16
 
 
17
 
>>> (fd,fname)=tempfile.mkstemp()
18
 
>>> write_yaml(G,fname);  
19
 
>>> Gin=read_yaml(fname);
20
 
>>> sorted(G.nodes())==sorted(Gin.nodes())
21
 
True
22
 
>>> sorted(G.edges())==sorted(Gin.edges())
23
 
True
24
 
>>> os.close(fd)
25
 
>>> os.unlink(fname)
26
 
 
27
 
 
28
 
>>> (fd,fname)=tempfile.mkstemp()
29
 
>>> write_yaml(DG,fname);  
30
 
>>> Gin=read_yaml(fname);
31
 
>>> sorted(DG.nodes())==sorted(Gin.nodes())
32
 
True
33
 
>>> sorted(DG.edges())==sorted(Gin.edges())
34
 
True
35
 
>>> os.close(fd)
36
 
>>> os.unlink(fname)
37
 
 
38
 
 
39
 
>>> (fd,fname)=tempfile.mkstemp()
40
 
>>> write_yaml(XG,fname);  
41
 
>>> Gin=read_yaml(fname);
42
 
>>> sorted(XG.nodes())==sorted(Gin.nodes())
43
 
True
44
 
>>> sorted(XG.edges(data=True))==sorted(Gin.edges(data=True))
45
 
True
46
 
>>> os.close(fd)
47
 
>>> os.unlink(fname)
48
 
 
49