Quickies

[categories] [index] [all (527)] [latest]

Python
  1. #!/usr/bin/python

    """
    $ python tests.py
    $ python tests.py TestDemo
    $ python tests.py TestDemo.test_foo
    """


    import unittest

    class TestDemo(unittest.TestCase):

        def setUp(self):
            pass
            
        def tearDown(self):
            pass

        def test_foo(self):
            self.assertTrue('a' in 'asd')
            self.assertEqual(1+1, 2)
        
        def test_bar(self):
            pass

    if __name__ == '__main__':
        unittest.main()