jonni83 / smartgarage

1 stars 1 forks source link

Testing framework #13

Open riverajo opened 10 years ago

riverajo commented 10 years ago

It looks as though you have not started using a testing framework. I suggest nose http://nose.readthedocs.org/en/latest/testing.html. Very simple and robust, allows you to setup and teardown like it like you want to.

jonni83 commented 10 years ago

i am currently using nose to run the tests. however I haven't figured out any good test yet. for now, the fact that each test executes means that i'm references proper pins and the logic for the specified functions doesn't fail out. I know that I need to figure out tests that validate a result, but i don't really have any results... I'll have to think about this one for a little while.

riverajo commented 10 years ago

Sorry what I mean is you test classes should inherit from unittest.TestCase. Also your setup()`` andteardownare miss-name they should be,setUp()andtearDown``` the class should look like:

import unittest

class TestHallEffectPair(unittest.Testcase):
    def setUp(self):
        pass

    def tearDown(slef):
        pass