Mercurial > hg > WSGraph
comparison tests/doctest.txt @ 35:52dedd2a8ffb
add some more tests
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Fri, 14 Dec 2012 20:47:41 -0800 |
| parents | 16673636dcb6 |
| children | 5ea58a6ea820 |
comparison
equal
deleted
inserted
replaced
| 34:16673636dcb6 | 35:52dedd2a8ffb |
|---|---|
| 35 >>> nodeA = {'hello': "is it me you're looking for?"} | 35 >>> nodeA = {'hello': "is it me you're looking for?"} |
| 36 >>> graph['A'] = nodeA | 36 >>> graph['A'] = nodeA |
| 37 >>> graph.edge('A', 'B', dict(foo='bar')) | 37 >>> graph.edge('A', 'B', dict(foo='bar')) |
| 38 >>> 'A' in graph | 38 >>> 'A' in graph |
| 39 True | 39 True |
| 40 >>> graph['A'] == nodeA | |
| 41 True | |
| 40 >>> ['A', 'B'] in graph | 42 >>> ['A', 'B'] in graph |
| 41 True | 43 True |
| 42 >>> graph[('A', 'C')] = {'why': "this will add 'C' to the graph"} | 44 >>> graph[('A', 'C')] = {'why': "this will add 'C' to the graph"} |
| 43 >>> 'C' in graph | 45 >>> 'C' in graph |
| 44 True | 46 True |
| 45 >>> graph['C'] | 47 >>> graph['C'] |
| 46 {} | 48 {} |
| 49 >>> sorted(graph.nodes()) | |
| 50 ['A', 'B', 'C'] |
