Skip to content
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

Merged
merged 9 commits into from Feb 19, 2014
Merged

Wdb wrapper #21

merged 9 commits into from Feb 19, 2014

Conversation

ncsaba
Copy link
Contributor

@ncsaba ncsaba commented Feb 19, 2014

Hi Bryan,

More primitive wrappers, nothing special...

Cheers,
Csaba

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)
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bryan,

Fixed in:

ncsaba@deb2323

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.

kanzure added a commit that referenced this pull request Feb 19, 2014
@kanzure kanzure merged commit 74664bf into kanzure:master Feb 19, 2014
@kanzure
Copy link
Owner

kanzure commented Feb 19, 2014

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants