Mercurial > hg > WSGraph
comparison tests/doctest.txt @ 36:5ea58a6ea820
tests for node integrity; TODO: edge integrity
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 14 Dec 2012 20:53:41 -0800 |
parents | 52dedd2a8ffb |
children | df2a719a9b6e |
comparison
equal
deleted
inserted
replaced
35:52dedd2a8ffb | 36:5ea58a6ea820 |
---|---|
46 True | 46 True |
47 >>> graph['C'] | 47 >>> graph['C'] |
48 {} | 48 {} |
49 >>> sorted(graph.nodes()) | 49 >>> sorted(graph.nodes()) |
50 ['A', 'B', 'C'] | 50 ['A', 'B', 'C'] |
51 | |
52 Once you set the value of a node or edge, modifying their data | |
53 structure will not affect the graph results: | |
54 | |
55 >>> values = {'a': 'b', 'c': 'easy as 1..2..3..'} | |
56 >>> graph['C'] = values | |
57 >>> graph.node('C') == values | |
58 True | |
59 >>> values['c'] = 'modifying the values' | |
60 >>> values['d'] = 'adding a new key' | |
61 >>> graph['C']['c'] | |
62 'easy as 1..2..3..' | |
63 >>> 'd' in graph['C'] | |
64 False |