Skip to content

Instantly share code, notes, and snippets.

@afaqk9394
Created September 18, 2019 01:03
Show Gist options
  • Select an option

  • Save afaqk9394/56c174d514cb63d6d37bd76df2a733f0 to your computer and use it in GitHub Desktop.

Select an option

Save afaqk9394/56c174d514cb63d6d37bd76df2a733f0 to your computer and use it in GitHub Desktop.
import unittest # importing standard unittest module from python library
from testapp.calculator import Calculator # import
class TddPython(unittest.TestCase): # our class that would contain multiple test cases
def test_calc_subtract_method(self): # test method
calc = Calculator() # initiliate the Calculator
result = calc.subtract(4,1)
self.assertEqual(3, result)
if __name__ == '__main__':
unittest.main() # execute test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment