Hi,

after grasping that the pylons-docs are a good way to understand how to deal 
with TG2, I took a look at the unit-testing for my planned authentication 
wrapping.

Now a problem seems to be that nosetests don't find the *.ini properly, and 
that the generate controller_test is hard-coded to use development.ini 
instead of test.ini.

So I had to change 

config 
= 
'config:'+(os.path.abspath(os.path.basename(__name__)+'/../../development.ini#main'))

to 

config 
= 'config:'+(os.path.abspath(os.path.basename(__name__)+'/../../test.ini#main'))

in tests/test_controllers.

I also have to run the tests doing 

nosetests -sw tests/   

otherwise nose complains with 

ERROR: Failure: OSError (File '/home/dir/projects/ableton/Web/test.ini' not 
found)

which seems to stem from nose not setting the CWD as expected by the above 
code. A solution would be to look from CWD upwards to where the test.ini is 
found (if any...) instead of hard-coding the ../../

So - shall  I create a ticket for this? And possibly even a patch?

Generally, what about DB-tests? I helped myself doing

class TestTGController:
    def test_index(self):
        import authenticationtest.model
        m = authenticationtest.model
        m.metadata.create_all()


(code that obviously will need to go into setUp, I'm just in the middle of 
working my way through this)

but shouldn't we supply some base-class that does that?

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to