Carl Karsten wrote:
> Paul McNett wrote:
>> Carl Karsten wrote:
>>> Paul McNett wrote:
>>>> Carl Karsten wrote:
>>>>> why is run_all_tests.py in tools/ and not
>>>>> http://svn.dabodev.com/trac/dabo/browser/trunk/tests
>>>> Because I put it there, and then Nate came on board and revamped the 
>>>> unit testing framework, and put it in a different place. We will 
>>>> eventually merge/refactor my unit tests, but for now they are in 
>>>> separate places.
>>>>
>>> What should I be modifying to add a test?
>> What module is your test testing?
>>
> 
> dbMySQL
>       def getDBs(self,user):
> 
> I guessed  test_dCursorMixin.py - added this:

got it (well, something):
        
        def test_getDBs(self):
                cur = self.cur
                self.assertEqual(cur.superMixin.getDBs(cur.superMixin(), 
'dabo_unittest'), None)
                ds = cur.getDataSet()
                print ds
     # ({'pk': 1L, 'cfield': u'Paul Keith McNett', 'nfield': Decimal("23 ...    
## - End method unit tests -

cur.superMixin() was to deal with:
TypeError: unbound method getDBs() must be called with dCursorMixin instance as 
first argument (got type instance instead)

Surprised I needed the ().  figured cur.superMixin was the reference to the 
instance.

So how do I get the DS that this code should have created:

        def getDBs(self,user):
                """Get the list of DBs the given user has access to.

       Unlike getTables and other getXs,
       this behaves more like a cursor by using .execute's
       self._records = dDataSet(_records) instead of returning it

                """
                tempCursor = self._connection.cursor()
                rows = tempCursor.execute("""select distinct table_schema
                        from information_schema.SCHEMA_PRIVILEGES
                        where GRANTEE like %(user)s
                        """, {'user':"'"+user+"'@%"} )
                # rs = tempCursor.fetchall()
                return rows


Carl K


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to