Esempio n. 1
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
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')
Esempio n. 5
0
 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')
Esempio n. 6
0
 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')
Esempio n. 7
0
 def test_do_stuff2(self):
     test_param = 'gerfer'
     result = main.do_stuff(test_param)
     self.assertIsInstance(result, ValueError)
Esempio n. 8
0
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)
Esempio n. 10
0
 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
Esempio n. 11
0
	def test_do_stuff2(self):
		''' Test 2 passed '''
		test_param = 'shkshks'
		result = main.do_stuff(test_param)
		self.assertEqual(result, ValueError)
Esempio n. 12
0
 def test_do_stuff3(self):
     test_param = None
     result = main.do_stuff(test_param)
     self.assertEqual(result, 'Please Enter a Number!')
Esempio n. 13
0
 def test_do_stuff5(self):
     test_param = 0
     result = main.do_stuff(test_param)
     self.assertEqual(result, 5)
Esempio n. 14
0
 def test_do_stuff5(self):
     test_param = ''
     result = main.do_stuff(test_param)
     self.assertIsInstance(result, Exception)
Esempio n. 15
0
 def test_do_stuff2(self):
     test_param = 'va a pinchar'
     result = main.do_stuff(test_param)
     self.assertEqual(result, 'please enter a number')
Esempio n. 16
0
 def test_do_stuff2(self):
     test_param = 'asds'
     result = main.do_stuff(test_param)
     self.assertTrue(isinstance(result, ValueError))
Esempio n. 17
0
 def test_do_stuff6(self):
     '''passing 0 and expecting 5'''
     test_param6 = 0
     result = main.do_stuff(test_param6)
     self.assertEqual(result, 5)
Esempio n. 18
0
 def test_do_stuff1(self):
     test_param='ftfgyj'
     result=main.do_stuff(test_param)
     self.assertIsInstance(result,ValueError)
Esempio n. 19
0
 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)
Esempio n. 20
0
 def test_do_stuff2(self):
     test_param = 'adfjadlsfjlf'
     result = main.do_stuff(test_param)
     self.assertIsInstance(result, ValueError)
Esempio n. 21
0
	def test_do_stuff3(self):
		''' Test 3 passed '''
		test_param = None
		result = main.do_stuff(test_param)
		self.assertEqual(result, 'Please enter a number')
Esempio n. 22
0
 def test_do_stuff5(self):
     test_param = 0
     result = main.do_stuff(test_param)
     self.assertEqual(result, 'put number more than 0')
Esempio n. 23
0
 def test_do_stuff(self):
     num=10
     result=main.do_stuff(num)
     self.assertEqual(result,15)
Esempio n. 24
0
 def test_do_stuff2(self):
     test_param = 'hsdihu'
     result = main.do_stuff(test_param)
     # self.assertTrue(isinstance(result, ValueError))
     self.assertIsInstance(result, ValueError)
Esempio n. 25
0
 def test_do_stuff4(self):
     test_param = ""
     result = main.do_stuff(test_param)
     self.assertEqual(result, "please enter number")
Esempio n. 26
0
 def test_do_stuff3(self):
     test_param = None
     result = main.do_stuff(test_param)
     self.assertIsInstance(result, TypeError)
Esempio n. 27
0
 def test_do_stuff3(self):
     tesT_param = None
     result = main.do_stuff(tesT_param)
     self.assertEqual(result, 'please enter number')
Esempio n. 28
0
 def test_do_stuff2(self):
     '''docstring #2'''
     test_param2 = 10
     result = main.do_stuff(test_param2)
     self.assertEqual(result, 3)
Esempio n. 29
0
 def test_do_stuff4(self):
     test_param = ''
     result = main.do_stuff(test_param)
     self.assertEqual(result, 'Please enter a number')
Esempio n. 30
0
 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)