Skip to content

Instantly share code, notes, and snippets.

@alwye
Created June 26, 2018 17:34
Show Gist options
  • Save alwye/f33b139323b0793065c13b74a4984887 to your computer and use it in GitHub Desktop.
Save alwye/f33b139323b0793065c13b74a4984887 to your computer and use it in GitHub Desktop.
Example of a unit test
import unittest
def multiply(a, b, c):
return a * b * c + 1
class MathTest(unittest.TestCase):
def testMultiply(self):
a = 2
b = 5
c = 5
expected = 50
actual = multiply(a, b, c)
self.assertEqual(expected, actual, 'Failed multiplication test.')
if __name__ == 'main':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment