def test_increment(self): """testing that the increment function adds one""" x = 7 y = increment(x) w = -10 v = increment(w) self.assertEqual(y, 8) self.assertEqual(v, -9)
def test_increment(self): x0 = 0 y0 = increment(x0) #y0 == 1 self.assertEqual(y0, 1) x1 = 100 y1 = increment(x1) #y1 == 101 self.assertEqual(y1, 101)
def test_increment(self): """Testing that increment adds one to a number.""" x1 = 5 y1 = increment(x1) x2 = -106 y2 = increment(x2) # Now we make sure the output is as expected with assertions self.assertEqual(y1, 6) self.assertEqual(y2, -105)
def test_increment(self): """Testing the increment function to add one to a number""" x1 = 9 y1 = increment(x1) x2 = -157 y2 = increment(x2) # Now we make sure the output is as expected with assertions self.assertEqual(y1, 10) self.assertEqual(y2, -157)
def test_increment(self): """Testing that the increment function adds one to a number.""" # Unit tests work by having some logic/values # that use the code being tested x1 = 7 y1 = increment(x1) x2 = -10 y2 = increment(x2) # And then making sure the output is as expected with assertions self.assertEqual(y1, 8) self.assertEqual(y2, -9)
def test_incriment(self): """Testing that increment adds one to a number.""" x0 = 0 y0 = increment(x0) self.assertEqual(y0, 1) x1 = 123 y1 = increment(x1) self.assertEqual(y1, 124) x2 = -57 y2 = increment(x2) self.assertEqual(y2, -56)
def test_increment(self): """Testing increment add one to a number""" x0 = 0 y0 = increment(x0) self.assertEqual(y0, 1) x1 = -1 y1 = increment(x1) self.assertEqual(y1, 0) x2 = 10.5 y2 = increment(x2) self.assertEqual(y2, 11.5)
def test_increment(self): """Testing that increment adds one to a number""" x0 = 0 y0 = increment(x0) # y0 == 1 self.assertEqual(y0, 1) x1 = 100 y1 = increment(x1) # y1 == 101 self.assertEqual(y1, 101) x2 = -1 y2 = increment(x2) # y2 == 0 self.assertEqual(y2, 0) x3 = -1.5 y3 = increment(x3) # y3 == -0.5 self.assertEqual(y3, -0.5)
def test_increment_random(self): ''' Test increment with randomly generated input ''' x1 = randint(1, 1000000) y1 = increment(x1) self.asserEqual(y1, x1 + 1)
def test_increment_random(self): """Testing the increment function adds 1 to any number 1-1000)""" x0 = randint(1,1000) y0 = increment(x0) self.assertEqual(x0 +1, y0)
def test_increment_random(self): """Test increment with randomly generated input.""" x1 = randint(1, 1000000) y1 = increment(x1) self.assertEqual(y1, x1 + 1)
def test_increment_random(self): """Test incrementing a random integer""" x1 = randint(1, 1000000) y1 = increment(x1) self.assertEqual(y1, x1 + 1)
from example_module import increment print(str(increment(1)))