def test_collatz_step(self): # you should probably write some tests to determine if collatz_step is # being correctly computed self.assertEqual(collatz_step(1), 1) self.assertEqual(collatz_step(3), 10) self.assertEqual(collatz_step(2), 1) self.assertEqual(collatz_step(5), 16) self.assertEqual(collatz_step(4), 2)
def test_collatz_step(self): # you should probably write some tests to determine if collatz_step is # being correctly computed # test even case m = collatz_step(20) self.assertEqual(m, 10) # test odd cade k = collatz_step(5) self.assertEqual(k, 16)
def test_collatz_step(self): # you should probably write some tests to determine if collatz_step is # test even case m = collatz_step(2); self.assertEqual(1, m) # test odd case m = collatz_step(5); self.assertEqual(16,m)
def test_collatz_step_error(self): # this test has been written for you. it demonstrates how to test if a # function raises an error with self.assertRaises(ValueError): collatz_step(-1) collatz_step(-2) collatz_step(-2.5) with self.assertRaises(TypeError): collatz_step(1.0)
def test_collatz_step_error(self): with self.assertRaises(ValueError): collatz_step(-1) collatz_step(-2) collatz_step(-19)
def test_collatz_step_one(self): self.assertEqual(collatz_step(1), 1)
def test_collatz_step(self): self.assertEqual(collatz_step(5), 16) self.assertEqual(collatz_step(16), 8) self.assertEqual(collatz_step(97), 292)
def test_collatz_step_one(self): # you should probably write a test to see if collatz_step handles the # n=1 case correctly self.assertEquals(collatz_step(1), 1)
def test_collatz_step(self): # you should probably write some tests to determine if collatz_step is # being correctly computed m = collatz_step(5) self.assertEqual(m, 16)
def test_collatz_step_error(self): # function raises an error with self.assertRaises(ValueError): collatz_step(-1) collatz_step(-2)
def test_collatz_step_one(self): # n=1 case correctly m = collatz_step(1); self.assertEqual(1,m)