eftsung / pygr

Automatically exported from code.google.com/p/pygr
0 stars 0 forks source link

Fix bug in sqlgraph.SQLTable.generic_iterator; add associated tests #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Calling SQLTable.iteritems() causes an error because the default 'cache_f'
function is incorrect.

'cache_f' defaults to the unbound class method cache_items(); it needs to
either be set to the bound method self.cache_items() (my solution) OR
'self' must be passed into cache_items() explicitly in the generic_iterator
function.

The patch also adds a new file, tests/sqltable_tests.py, that tests basic
dict reading behavior.  DictMixin is used to provide 'get' functionality
among others.  dict writing and deletion is not tested.

Original issue reported on code.google.com by the.good...@gmail.com on 3 Sep 2008 at 2:03

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by cjlee...@gmail.com on 11 Sep 2008 at 3:39

GoogleCodeExporter commented 8 years ago

Original comment by mare...@gmail.com on 21 Feb 2009 at 2:05

GoogleCodeExporter commented 8 years ago

Original comment by cjlee...@gmail.com on 4 Mar 2009 at 11:37