En Fri, 23 Apr 2010 03:15:16 -0300, Cameron Simpson
escribió:
On 23Apr2010 15:37, I wrote:
| Experienced users will see at once what's happened: I've made a Node
| myself in the test using the local class, and the Node class is thus
| __main__.Node. However, my sql Backend class has independ
On 4/23/2010 8:03 AM, Cameron Simpson wrote:
On 23Apr2010 13:25, Peter Otten<__pete...@web.de> wrote:
| Move the unit tests into a separate script and have that import the module
| cs.nodedb.node.
Hmm. I have been very attracted by the idea of having the unittest in
the module itself, and ru
On 23Apr2010 13:25, Peter Otten <__pete...@web.de> wrote:
| Cameron Simpson wrote:
| > and it's failing. I've traced the failure cause, ending up with this
| > assertion message from the end of serialise() above:
| >
| > AssertionError: HOST:foo:{}'cs.nodedb.node.Node'>
| >
| > Experienced
Cameron Simpson wrote:
> and it's failing. I've traced the failure cause, ending up with this
> assertion message from the end of serialise() above:
>
> AssertionError: HOST:foo:{}'cs.nodedb.node.Node'>
>
> Experienced users will see at once what's happened: I've made a Node
> myself in t
I've run into a problem unittesting something I'm writing.
I have a little node tracking class I'm using to track items and
attributes. An item is a "Node" object, and the collection is a
"NodeDB".
So I'm writing some unittests, thus:
class Node(dict): [...]
class NodeDB(dic): [...]
class
On 23Apr2010 16:15, I wrote:
| On 23Apr2010 15:37, I wrote:
| | class Backend(object):
| | def serialise(self, value):
| | ''' Convert a value for external string storage.
| | '''
| | if isinstance(value, Node): [...]
| | return ":%s:%s" % (value.type, value.name)
|
On 23Apr2010 15:37, I wrote:
| class Backend(object):
| def serialise(self, value):
| ''' Convert a value for external string storage.
| '''
| if isinstance(value, Node): [...]
| return ":%s:%s" % (value.type, value.name)
| t = type(value)
| assert t in (