Diez,

I would simply copy your development.ini to test.ini and not skip a
beat.  This "feature" is not likely to be removed, because I can
imagine a scenario where a developer would like a different ini file
for unit testing than that of development.

As far as database tests are concerned, take a look at:
http://pythontutorials.googlecode.com/svn/tutorials/barbershop/ In
that project I set up a test framework which shows how to use sqlite
to test the database.

cheers.
-chris

On Jul 9, 9:34 am, "Mark Ramm" <[EMAIL PROTECTED]> wrote:
> Yea, make a ticket for this, and patches always appreciated. ;)
>
> I think there was a desire to port the work that was done on creating
> a WebTest based testutil module for 1.5 to tg2, and now that the 1.5
> testing story is finished, we should look at this much more closely.
>
> --Mark
>
> On Wed, Jul 9, 2008 at 6:49 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > 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
>
> --
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog:www.compoundthinking.com/blog
--~--~---------~--~----~------------~-------~--~----~
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