New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wdb wrapper #21
Wdb wrapper #21
Conversation
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
"""
raise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Bryan,
Fixed in:
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.
"""
passdef test_foobar(...):
"""
Query the foobar and check the resulting zonk.
"""
—
Reply to this email directly or view it on GitHub.
Thank you! |
Hi Bryan,
More primitive wrappers, nothing special...
Cheers,
Csaba