def test_modulus_argument_polar(self):
     complex = ComplexNumber(3, 4)
     self.assertEqual(complex.getModulus(), 5)
     self.assertAlmostEqual(complex.getArgument(), 53.13)
     self.assertEqual(complex.getPolarForm(), '5(cos(53.13) + isin(53.13))')
     complex.setRealPart(-4)
     complex.setImagPart(-3)
     self.assertEqual(complex.getModulus(), 5)
     self.assertAlmostEqual(complex.getArgument(), 36.87)
     self.assertEqual(complex.getPolarForm(), '5(cos(36.87) + isin(36.87))')
 def test_gets_sets_str(self):
     complex = ComplexNumber(1, 2)
     complex1 = ComplexNumber(1, -1)
     self.assertEqual(complex.getRealPart(), 1)
     self.assertEqual(complex.getImagPart(), 2)
     self.assertEqual(complex1.getRealPart(), 1)
     self.assertEqual(complex1.getImagPart(), -1)
     self.assertEqual(str(complex), '1 +2i')
     complex.setRealPart(4)
     complex.setImagPart(-100)
     self.assertEqual(complex.getRealPart(), 4)
     self.assertEqual(complex.getImagPart(), -100)
     self.assertEqual(str(complex), '4 -100i')
 def test_multiply(self):
     complex = ComplexNumber(3, 4)
     multiply = complex.multiplyReal(3)
     self.assertEqual(multiply.getRealPart(), 9)
     self.assertEqual(multiply.getImagPart(), 12)
     multiply = complex.multiplyImag(3)
     self.assertEqual(multiply.getRealPart(), -12)
     self.assertEqual(multiply.getImagPart(), 9)
     complex.setRealPart(-3)
     complex.setImagPart(-4)
     multiply = complex.multiplyReal(3)
     self.assertEqual(multiply.getRealPart(), -9)
     self.assertEqual(multiply.getImagPart(), -12)
     multiply = complex.multiplyImag(3)
     self.assertEqual(multiply.getRealPart(), 12)
     self.assertEqual(multiply.getImagPart(), -9)