# HG changeset patch # User Jeff Hammel # Date 1355451112 28800 # Node ID 2fe3933f8eca4010d47e299d9380df9f58d6fc54 # Parent 2e4ed8e0a103406514571a2393ce0d891f52eee3 Yay! we now haz failing tests diff -r 2e4ed8e0a103 -r 2fe3933f8eca tests/doctest.txt --- a/tests/doctest.txt Thu Dec 13 18:05:39 2012 -0800 +++ b/tests/doctest.txt Thu Dec 13 18:11:52 2012 -0800 @@ -5,3 +5,35 @@ >>> from wsgraph.model import MemoryCache +Make a graph: + + >>> graph = MemoryCache() + +The graph starts off empty: + + >>> graph() == {'nodes': {}, 'edges': {}} + True + >>> graph.nodes() + [] + >>> graph.edges() + [] + >>> graph.node('A') is None + True + >>> graph['A'] is None + True + >>> graph.edge('A', 'B') is None + True + >>> graph[('A', 'B')] is None + True + >>> 'A' in graph + False + >>> ('A', 'B') in graph + False + +Let's add stuff to it: + + >>> nodeA = {'hello': "is it me you're looking for?"} + >>> graph['A'] = nodeA + >>> graph.edge('A', 'B', foo='bar') + >>> 'A' in graph + True