Mercurial > hg > WSGraph
changeset 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 | f17a6577cc0d |
files | tests/doctest.txt |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/doctest.txt Fri Dec 14 20:47:41 2012 -0800 +++ b/tests/doctest.txt Fri Dec 14 20:53:41 2012 -0800 @@ -48,3 +48,17 @@ {} >>> sorted(graph.nodes()) ['A', 'B', 'C'] + +Once you set the value of a node or edge, modifying their data +structure will not affect the graph results: + + >>> values = {'a': 'b', 'c': 'easy as 1..2..3..'} + >>> graph['C'] = values + >>> graph.node('C') == values + True + >>> values['c'] = 'modifying the values' + >>> values['d'] = 'adding a new key' + >>> graph['C']['c'] + 'easy as 1..2..3..' + >>> 'd' in graph['C'] + False