Hi Bryan,

Fixed in:

https://github.com/ncsaba/python-brlcad/commit/deb2323e4f707432042f0fdb541fe2e366beb2c9

I've broken the tests down per primitive type, but left the creation of
the test DB in one block - it is very useful for me to have one single
file where I can visually test what I get.

If that's not enough, of course all that can be broken further down, but
for now I would like to keep it as it is.

Cheers,
Csaba

On Mi, 2014-02-19 at 11:16 -0800, Bryan Bishop wrote:
> In tests/test_wdb.py:
> 
> >              check_tgc = functools.partial(self.check_tgc, brl_db)
> >              check_tgc("rcc.s", "0, 0, 0, 0, 0, 1, 0, -1, 0, -1, 0, 0, 0, -1, 0, -1, 0, 0")
> >              check_tgc("tgc.s", "0, 0, 0, 0, 0, 1, 0, 1, 0, 0.5, 0, 0, 0, 0.5, 0, 1, 0, 0")
> >              check_tgc("cone.s", "0, 0, 0, 0, 0, 1, 0, -1, 0, 1, 0, 0, 0, -0.5, 0, 0.5, 0, 0")
> >              check_tgc("trc.s", "0, 0, 0, 0, 0, 1, 0, -1, 0, -1, 0, 0, 0, -0.5, 0, -0.5, 0, 0")
> > +            shape = brl_db.lookup_internal("torus.s")
> > +            self.assertTrue(shape.center.is_same((0, 0, 0)))
> > +            self.assertTrue(shape.n.is_same((0, 0, 1)))
> > +            self.assertEqual(1, shape.r_revolution)
> > +            self.assertEqual(0.2, shape.r_cross)
> > +            shape = brl_db.lookup_internal("eto.s")
> > +            self.assertTrue(shape.center.is_same((0, 0, 0)))
> > +            self.assertTrue(shape.n.is_same((0, 0, 1)))
> > +            self.assertTrue(shape.s_major.is_same((0, 0.5, 0.5)))
> > +            self.assertEqual(1, shape.r_revolution)
> 
> Most of these should be separate tests (in separate functions). This
> is useful because changes don't become "blocking"; e.g., if you test
> multiple things separately then the aggregate failures are usually
> more informative than "something is breaking".
> 
> def test_whatever(...):
>    """
>    This tests the whatever.
>    """
>    pass
> 
> def test_foobar(...):
>     """
>     Query the foobar and check the resulting zonk.
>     """
> —
> Reply to this email directly or view it on GitHub.
>