def test_do_stuff(self): ''' hi ''' test_param = 10 result = main.do_stuff(test_param) self.assertEqual(result, 15)
def test_do_stuff(self): """ Just a test """ test_param = 10 result = main.do_stuff(test_param) self.assertEqual(result, 15)
def test_do_stuff(self): test_param = 10 result = main.do_stuff(test_param) """ here result = actual result & 15 is excepted result if both match test success """ self.assertEqual(result, 15)
class TestMain(unittest.TestCase): def setUp(self): print('about to do a function') def test_do_stuff(self): test_param=10 result = main.do_stuff(test_param) self.assertEqual(result, 15) def test_do_stuff(unittest.TestCase): test_param = None result = main.do_stuff(test_param) self.assertEqual(result, 'please enter number')
def test_do_stuff5(self): '''passing an empty string, expecting \'please enter a number\'''' test_param5 = '' result = main.do_stuff(test_param5) self.assertEqual(result, 'please enter a number')
def test_do_stuff4(self): '''passing \'None\' as a param and expecting \'please enter a number\'''' test_param4 = None result = main.do_stuff(test_param4) self.assertEqual(result, 'please enter a number')
def test_do_stuff2(self): test_param = 'gerfer' result = main.do_stuff(test_param) self.assertIsInstance(result, ValueError)
def test_thing(): assert do_stuff() == 2
def test_do_stuff2(self): test_param = "dahdadh" result = main.do_stuff(test_param) self.assertIsInstance(result, ValueError)
def test_do_stuff(self): # We're testing the do_stuff function in the main.py file. We create the method(cause it's in a class)that will receive self test_param = 10 result = main.do_stuff(test_param) self.assertEqual(result, 15) # This is the key part of unit test. This makes sure that the two parameters are equal
def test_do_stuff2(self): ''' Test 2 passed ''' test_param = 'shkshks' result = main.do_stuff(test_param) self.assertEqual(result, ValueError)
def test_do_stuff3(self): test_param = None result = main.do_stuff(test_param) self.assertEqual(result, 'Please Enter a Number!')
def test_do_stuff5(self): test_param = 0 result = main.do_stuff(test_param) self.assertEqual(result, 5)
def test_do_stuff5(self): test_param = '' result = main.do_stuff(test_param) self.assertIsInstance(result, Exception)
def test_do_stuff2(self): test_param = 'va a pinchar' result = main.do_stuff(test_param) self.assertEqual(result, 'please enter a number')
def test_do_stuff2(self): test_param = 'asds' result = main.do_stuff(test_param) self.assertTrue(isinstance(result, ValueError))
def test_do_stuff6(self): '''passing 0 and expecting 5''' test_param6 = 0 result = main.do_stuff(test_param6) self.assertEqual(result, 5)
def test_do_stuff1(self): test_param='ftfgyj' result=main.do_stuff(test_param) self.assertIsInstance(result,ValueError)
def test_do_stuff2(self): # We're testing the do_stuff function in the main.py file. We create the method(cause it's in a # class)that will receice self test_param = 'hgczvxvjhb' result = main.do_stuff(test_param) self.assertIsInstance(result, ValueError)
def test_do_stuff2(self): test_param = 'adfjadlsfjlf' result = main.do_stuff(test_param) self.assertIsInstance(result, ValueError)
def test_do_stuff3(self): ''' Test 3 passed ''' test_param = None result = main.do_stuff(test_param) self.assertEqual(result, 'Please enter a number')
def test_do_stuff5(self): test_param = 0 result = main.do_stuff(test_param) self.assertEqual(result, 'put number more than 0')
def test_do_stuff(self): num=10 result=main.do_stuff(num) self.assertEqual(result,15)
def test_do_stuff2(self): test_param = 'hsdihu' result = main.do_stuff(test_param) # self.assertTrue(isinstance(result, ValueError)) self.assertIsInstance(result, ValueError)
def test_do_stuff4(self): test_param = "" result = main.do_stuff(test_param) self.assertEqual(result, "please enter number")
def test_do_stuff3(self): test_param = None result = main.do_stuff(test_param) self.assertIsInstance(result, TypeError)
def test_do_stuff3(self): tesT_param = None result = main.do_stuff(tesT_param) self.assertEqual(result, 'please enter number')
def test_do_stuff2(self): '''docstring #2''' test_param2 = 10 result = main.do_stuff(test_param2) self.assertEqual(result, 3)
def test_do_stuff4(self): test_param = '' result = main.do_stuff(test_param) self.assertEqual(result, 'Please enter a number')
def test_do_stuff3(self): '''passing \'askj\' as a param and expecting a ValueError''' test_param3 = 'askj' result = main.do_stuff(test_param3) self.assertIsInstance(result, ValueError)