Carl Karsten wrote:
> Paul McNett wrote:
>> 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
>> Ok
>>
>>> def getDBs(self,user):
>>>
>>> I guessed test_dCursorMixin.py - added this:
>>>
>>> def test_getDBs(self):
>>> cur = self.cur
>>> self.assertEqual(cur.getDBs(), {})
>>>
>>> ## - End method unit tests -
>>>
>>>
>>> and get:
>>>
>>> AttributeError: 'DaboCursor' object has no attribute 'getDBs'
>> Good, that's expected, because getDBs isn't a method of dCursorMixin,
>> right? So now that you have a failing test, you now add getDBs to
>> dCursorMixin and dBackend, and now your getDBs in dbMySQL overrides the
>> getDBs in dBackend.
>>
>
> Add a getDBs() to dCursorMixin. dBackend, and dbMySQL?
>
> I get the dBackend one, what goes in dCursorMixin ?
In order for user code to have a hope of getting access to your getDBs()
method, it really needs to be accessible from dBizobj. So, you'd have:
dBizobj:
getDBs(): -> calls _CurrentCursor.getDBs()
dCursorMixin:
getDBs(): -> calls BackendObject.getDBs()
dBackend:
getDBs(): stub method to be overridden in subclasses,
return () by default.
dMySQL:
getDBs(): your code that returns the tuple of dbs.
--
pkm ~ http://paulmcnett.com
_______________________________________________
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]