Skip to content

Instantly share code, notes, and snippets.

@Mooophy
Created March 10, 2015 07:20
Show Gist options
  • Select an option

  • Save Mooophy/dd254155f4d53276c5ec to your computer and use it in GitHub Desktop.

Select an option

Save Mooophy/dd254155f4d53276c5ec to your computer and use it in GitHub Desktop.
import unittest
# Here's our "unit".
def IsOdd(n):
return n % 2 == 1
# Here's our "unit tests".
class IsOddTests(unittest.TestCase):
def testOne(self):
# self.failUnless(IsOdd(1))
self.assertTrue(IsOdd(1))
def testTwo(self):
self.assertFalse(IsOdd(2))
def main():
unittest.main()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment