Esempio n. 1
0
    def test_input_empty(self):
        ''' To give comment for test '''
        num = ""
        result = add.sum5(num)

        #self.assertTrue(isinstance(result, ValueError))
        self.assertEqual(result, "Please enter a number")
Esempio n. 2
0
    def test_input_None(self):
        num = None
        result = add.sum5(num)

        #self.assertTrue(isinstance(result, ValueError))
        self.assertEqual(result, "Please enter a number")
Esempio n. 3
0
    def test_addition_Error(self):
        num = "sdfsfddsf"
        result = add.sum5(num)

        #self.assertTrue(isinstance(result, ValueError))
        self.assertIsInstance(result, ValueError)
Esempio n. 4
0
    def test_addition(self):
        ''' To give comment for test  - will only work for test not for setUp or teatDown'''
        num = 10
        result = add.sum5(num)

        self.assertEqual(result, 15)
Esempio n. 5
0
 def test_input_empty(self):
     ''' To give comment for test '''
     num = ""
     result = add.sum5(num)
     self.assertEqual(result, "Please enter a number")
Esempio n. 6
0
 def test_input_None(self):
     num = None
     result = add.sum5(num)
     self.assertEqual(result, "Please enter a number")