def test_root_string(self): self.assertEqual('Invalid input', calc.root(1, '1'))
def test_root_string_2(self): self.assertEqual('Invalid input', calc.root('1', 1))
def test_float_root_exact(self): self.assertEquals(2.5, calc.root(6.25, 2))
def test_float_root_almost(self): self.assertAlmostEquals(2.2360679775, calc.root(5, 2), places=5)
def test_root_zero_y(self): self.assertEqual('Invalid input', calc.root(1, 0))
def test_root_zero_x(self): self.assertEqual(0, calc.root(0, 1))
def test_root_float_y(self): self.assertEqual('Invalid input', calc.root(27, 3.5))
def test_root_negative_even(self): self.assertEqual('Invalid input', calc.root(-27, 2))
def test_root_negative(self): self.assertEqual(-3, calc.root(-27, 3))
def test_root(self): self.assertEqual(3, calc.root(27, 3))
def test_complex_sqrt(self): self.assertEqual(root(-4, 2), Complex(1, 2))