# HG changeset patch # User Jeff Hammel # Date 1355454360 28800 # Node ID 16673636dcb6b9668e4f707bf021437c51d4e3bf # Parent c880cf90f01d8d4d6caba2b48aedd787dd7f8e2b wow, testing is fun! diff -r c880cf90f01d -r 16673636dcb6 tests/doctest.txt --- a/tests/doctest.txt Thu Dec 13 19:00:30 2012 -0800 +++ b/tests/doctest.txt Thu Dec 13 19:06:00 2012 -0800 @@ -37,3 +37,10 @@ >>> graph.edge('A', 'B', dict(foo='bar')) >>> 'A' in graph True + >>> ['A', 'B'] in graph + True + >>> graph[('A', 'C')] = {'why': "this will add 'C' to the graph"} + >>> 'C' in graph + True + >>> graph['C'] + {} diff -r c880cf90f01d -r 16673636dcb6 wsgraph/model.py --- a/wsgraph/model.py Thu Dec 13 19:00:30 2012 -0800 +++ b/wsgraph/model.py Thu Dec 13 19:06:00 2012 -0800 @@ -99,7 +99,7 @@ else: # getter # TODO: deepcopy - return self._nodes.get(name, None) + return deepcopy(self._nodes.get(name, None)) def nodes(self): return self._nodes.keys() @@ -113,7 +113,7 @@ else: # getter # TODO: deepcopy - return self._edges.get((node1, node2), None) + return deepcopy(self._edges.get((node1, node2), None)) def edges(self): return self._edges.keys()