• Home
  • Raw
  • Download

Lines Matching refs:assertAlmostEqual

25     def assertAlmostEqual(self, a, b):  member in ComplexTest
28 unittest.TestCase.assertAlmostEqual(self, a.real, b.real)
29 unittest.TestCase.assertAlmostEqual(self, a.imag, b.imag)
31 unittest.TestCase.assertAlmostEqual(self, a.real, b)
32 unittest.TestCase.assertAlmostEqual(self, a.imag, 0.)
35 unittest.TestCase.assertAlmostEqual(self, a, b.real)
36 unittest.TestCase.assertAlmostEqual(self, 0., b.imag)
38 unittest.TestCase.assertAlmostEqual(self, a, b)
111 self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)
213 self.assertAlmostEqual(pow(1+1j, 0+0j), 1.0)
214 self.assertAlmostEqual(pow(0+0j, 2+0j), 0.0)
216 self.assertAlmostEqual(pow(1j, -1), 1/1j)
217 self.assertAlmostEqual(pow(1j, 200), 1)
323 self.assertAlmostEqual(complex("1+10j"), 1+10j)
324 self.assertAlmostEqual(complex(10), 10+0j)
325 self.assertAlmostEqual(complex(10.0), 10+0j)
326 self.assertAlmostEqual(complex(10), 10+0j)
327 self.assertAlmostEqual(complex(10+0j), 10+0j)
328 self.assertAlmostEqual(complex(1,10), 1+10j)
329 self.assertAlmostEqual(complex(1,10), 1+10j)
330 self.assertAlmostEqual(complex(1,10.0), 1+10j)
331 self.assertAlmostEqual(complex(1,10), 1+10j)
332 self.assertAlmostEqual(complex(1,10), 1+10j)
333 self.assertAlmostEqual(complex(1,10.0), 1+10j)
334 self.assertAlmostEqual(complex(1.0,10), 1+10j)
335 self.assertAlmostEqual(complex(1.0,10), 1+10j)
336 self.assertAlmostEqual(complex(1.0,10.0), 1+10j)
337 self.assertAlmostEqual(complex(3.14+0j), 3.14+0j)
338 self.assertAlmostEqual(complex(3.14), 3.14+0j)
339 self.assertAlmostEqual(complex(314), 314.0+0j)
340 self.assertAlmostEqual(complex(314), 314.0+0j)
341 self.assertAlmostEqual(complex(3.14+0j, 0j), 3.14+0j)
342 self.assertAlmostEqual(complex(3.14, 0.0), 3.14+0j)
343 self.assertAlmostEqual(complex(314, 0), 314.0+0j)
344 self.assertAlmostEqual(complex(314, 0), 314.0+0j)
345 self.assertAlmostEqual(complex(0j, 3.14j), -3.14+0j)
346 self.assertAlmostEqual(complex(0.0, 3.14j), -3.14+0j)
347 self.assertAlmostEqual(complex(0j, 3.14), 3.14j)
348 self.assertAlmostEqual(complex(0.0, 3.14), 3.14j)
349 self.assertAlmostEqual(complex("1"), 1+0j)
350 self.assertAlmostEqual(complex("1j"), 1j)
351 self.assertAlmostEqual(complex(), 0)
352 self.assertAlmostEqual(complex("-1"), -1)
353 self.assertAlmostEqual(complex("+1"), +1)
354 self.assertAlmostEqual(complex("(1+2j)"), 1+2j)
355 self.assertAlmostEqual(complex("(1.3+2.2j)"), 1.3+2.2j)
356 self.assertAlmostEqual(complex("3.14+1J"), 3.14+1j)
357 self.assertAlmostEqual(complex(" ( +3.14-6J )"), 3.14-6j)
358 self.assertAlmostEqual(complex(" ( +3.14-J )"), 3.14-1j)
359 self.assertAlmostEqual(complex(" ( +3.14+j )"), 3.14+1j)
360 self.assertAlmostEqual(complex("J"), 1j)
361 self.assertAlmostEqual(complex("( j )"), 1j)
362 self.assertAlmostEqual(complex("+J"), 1j)
363 self.assertAlmostEqual(complex("( -j)"), -1j)
364 self.assertAlmostEqual(complex('1e-500'), 0.0 + 0.0j)
365 self.assertAlmostEqual(complex('-1e-500j'), 0.0 - 0.0j)
366 self.assertAlmostEqual(complex('-1e-500+1e-500j'), -0.0 + 0.0j)
369 self.assertAlmostEqual(complex(complex2(1+1j)), 1+1j)
370 self.assertAlmostEqual(complex(real=17, imag=23), 17+23j)
371 self.assertAlmostEqual(complex(real=17+23j), 17+23j)
372 self.assertAlmostEqual(complex(real=17+23j, imag=23), 17+46j)
373 self.assertAlmostEqual(complex(real=1+2j, imag=3+4j), -3+5j)
457 self.assertAlmostEqual(complex(float2(42.)), 42)
458 self.assertAlmostEqual(complex(real=float2(17.), imag=float2(23.)), 17+23j)
467 self.assertAlmostEqual(complex(MyIndex(42)), 42.0+0.0j)
468 self.assertAlmostEqual(complex(123, MyIndex(42)), 123.0+42.0j)
546 self.assertAlmostEqual((num.real**2 + num.imag**2) ** 0.5, abs(num))