Home
last modified time | relevance | path

Searched refs:assertAlmostEqual (Results 1 – 25 of 50) sorted by relevance

12

/third_party/python/Lib/test/
Dtest_complex.py25 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)
[all …]
Dtest_turtle.py130 self.assertAlmostEqual(
219 self.assertAlmostEqual(answer, expected)
240 self.assertAlmostEqual(abs(Vec2D(2.5, 6)), 6.5)
267 self.assertAlmostEqual(self.nav.xcor(), 100)
268 self.assertAlmostEqual(self.nav.ycor(), -100)
287 self.assertAlmostEqual(self.nav.xcor(), 100)
288 self.assertAlmostEqual(self.nav.ycor(), -100)
290 self.assertAlmostEqual(self.nav.xcor(), 0)
291 self.assertAlmostEqual(self.nav.ycor(), 0)
320 self.assertAlmostEqual(self.nav.distance(Vec2D(0,0)), expected)
[all …]
Dtest_cmath.py154 self.assertAlmostEqual(cmath.pi, pi_expected, places=9,
156 self.assertAlmostEqual(cmath.e, e_expected, places=9,
465 self.assertAlmostEqual(phase(0), 0.)
466 self.assertAlmostEqual(phase(1.), 0.)
467 self.assertAlmostEqual(phase(-1.), pi)
468 self.assertAlmostEqual(phase(-1.+1E-300j), pi)
469 self.assertAlmostEqual(phase(-1.-1E-300j), -pi)
470 self.assertAlmostEqual(phase(1j), pi/2)
471 self.assertAlmostEqual(phase(-1j), -pi/2)
480 self.assertAlmostEqual(phase(complex(-INF, -0.0)), -pi)
[all …]
Dtest_colorsys.py14 self.assertAlmostEqual(tr1[0], tr2[0])
15 self.assertAlmostEqual(tr1[1], tr2[1])
16 self.assertAlmostEqual(tr1[2], tr2[2])
Dtest_statistics.py2164 self.assertAlmostEqual(geometric_mean([54, 24, 36]), 36.0)
2165 self.assertAlmostEqual(geometric_mean([4.0, 9.0]), 6.0)
2166 self.assertAlmostEqual(geometric_mean([17.625]), 17.625)
2200 self.assertAlmostEqual(actual_mean, expected_mean, places=5)
2454 self.assertAlmostEqual(statistics.correlation(x, y), result)
2455 self.assertAlmostEqual(statistics.covariance(x, y), result)
2460 self.assertAlmostEqual(statistics.correlation(x, y), 0.5)
2461 self.assertAlmostEqual(statistics.covariance(x, y), 5)
2464 self.assertAlmostEqual(statistics.correlation(x, y), 1)
2465 self.assertAlmostEqual(statistics.covariance(x, y), 0.1)
[all …]
Dtest_xdrlib.py45 self.assertAlmostEqual(up.unpack_float(), 1.9)
46 self.assertAlmostEqual(up.unpack_double(), 1.9)
Dtest_random.py718 self.assertAlmostEqual(a,e,places=14)
1044 self.assertAlmostEqual(s1/N, mu, places=2,
1046 self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2,
1108 self.assertAlmostEqual(returned_value, 2.53)
1119 self.assertAlmostEqual(returned_value, 1.877208182372648)
1130 self.assertAlmostEqual(gammavariate_returned_value, expovariate_returned_value)
1183 self.assertAlmostEqual(returned_value, 1.4499999999997544)
1200 self.assertAlmostEqual(returned_value, 1.5830349561760781)
1305 self.assertAlmostEqual(random.NV_MAGICCONST, 1.71552776992141)
1306 self.assertAlmostEqual(random.TWOPI, 6.28318530718)
[all …]
Dtest_builtin.py603 self.assertAlmostEqual(result[0], exp_result[0])
604 self.assertAlmostEqual(result[1], exp_result[1])
1257 self.assertAlmostEqual(pow(0.,0), 1.)
1258 self.assertAlmostEqual(pow(0.,1), 0.)
1259 self.assertAlmostEqual(pow(1.,0), 1.)
1260 self.assertAlmostEqual(pow(1.,1), 1.)
1262 self.assertAlmostEqual(pow(2.,0), 1.)
1263 self.assertAlmostEqual(pow(2.,10), 1024.)
1264 self.assertAlmostEqual(pow(2.,20), 1024.*1024.)
1265 self.assertAlmostEqual(pow(2.,30), 1024.*1024.*1024.)
[all …]
Dtest_difflib.py11 self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
17 self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
26 self.assertAlmostEqual(sm.ratio(), 0.994, places=3)
55 self.assertAlmostEqual(sm.ratio(), 0, places=3)
60 self.assertAlmostEqual(sm.ratio(), 0.9975, places=3)
Dtest_future3.py20 self.assertAlmostEqual(7 / 2, 3.5)
Dtest_configparser.py130 self.assertAlmostEqual(cf.getfloat('Types', 'float'), 0.44)
154 self.assertAlmostEqual(cf.getfloat('Types', 'float',
156 self.assertAlmostEqual(cf.getfloat('Types', 'no-such-float',
217 self.assertAlmostEqual(cf['Types'].getfloat('float', 0.0), 0.44)
218 self.assertAlmostEqual(cf['Types'].getfloat('float',
220 self.assertAlmostEqual(cf['Types'].getfloat('no-such-float', 0.0), 0.0)
221 self.assertAlmostEqual(cf['Types'].getfloat('no-such-float',
987 self.assertAlmostEqual(cf[self.default_section].getfloat('1'), 2.4)
990 self.assertAlmostEqual(cf[self.default_section].getfloat('a'), 5.2)
1138 self.assertAlmostEqual(cf[self.default_section]['a'], 5.2)
Dtest_fractions.py320 self.assertAlmostEqual(2.0/3,
386 self.assertAlmostEqual(z.real, 0)
496 self.assertAlmostEqual(0, z.real)
675 self.assertAlmostEqual(math.pi, s)
689 self.assertAlmostEqual(math.cos(1), s)
/third_party/python/Lib/unittest/test/
Dtest_assertions.py11 self.assertAlmostEqual(1.00000001, 1.0)
14 self.assertAlmostEqual, 1.0000001, 1.0)
18 self.assertAlmostEqual(1.1, 1.0, places=0)
20 self.assertAlmostEqual, 1.1, 1.0, places=1)
22 self.assertAlmostEqual(0, .1+.1j, places=0)
25 self.assertAlmostEqual, 0, .1+.1j, places=1)
29 self.assertAlmostEqual(float('inf'), float('inf'))
34 self.assertAlmostEqual(1.1, 1.0, delta=0.5)
35 self.assertAlmostEqual(1.0, 1.1, delta=0.5)
39 self.assertAlmostEqual(1.0, 1.0, delta=0.5)
[all …]
D_test_warnings.py33 self.assertAlmostEqual(2+2, 4)
/third_party/python/Lib/test/test_asyncio/
Dtest_queues.py31 self.assertAlmostEqual(0.1, when)
33 self.assertAlmostEqual(0.2, when)
105 self.assertAlmostEqual(0.01, when)
107 self.assertAlmostEqual(0.02, when)
140 self.assertAlmostEqual(0.02, loop.time())
171 self.assertAlmostEqual(0.01, when)
198 self.assertAlmostEqual(0.01, loop.time())
213 self.assertAlmostEqual(0.01, when)
215 self.assertAlmostEqual(0.061, when)
232 self.assertAlmostEqual(0.06, loop.time())
[all …]
Dtest_tasks.py634 self.assertAlmostEqual(10.0, when)
987 self.assertAlmostEqual(0.1, when)
989 self.assertAlmostEqual(0.2, when)
991 self.assertAlmostEqual(0.3, when)
1013 self.assertAlmostEqual(0.3, loop.time())
1030 self.assertAlmostEqual(0, when)
1041 self.assertAlmostEqual(0, loop.time())
1046 self.assertAlmostEqual(0, when)
1059 self.assertAlmostEqual(0, loop.time())
1065 self.assertAlmostEqual(0.2, when)
[all …]
/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/
Ddescriptor_test.py241 self.assertAlmostEqual(12.3456789, message_options.Extensions[
243 self.assertAlmostEqual(1.234567890123456789, message_options.Extensions[
257 self.assertAlmostEqual(12, message_options.Extensions[
259 self.assertAlmostEqual(154, message_options.Extensions[
265 self.assertAlmostEqual(-12, message_options.Extensions[
267 self.assertAlmostEqual(-154, message_options.Extensions[
Dmessage_test.py328 self.assertAlmostEqual(message.repeated_float[0], 1.1)
329 self.assertAlmostEqual(message.repeated_float[1], 1.2)
330 self.assertAlmostEqual(message.repeated_float[2], 1.3)
/third_party/python/Lib/tkinter/test/test_tkinter/
Dtest_variables.py262 self.assertAlmostEqual(1.23, v.get())
264 self.assertAlmostEqual(3.45, v.get())
268 self.assertAlmostEqual(1.23, v.get())
270 self.assertAlmostEqual(3.45, v.get())
272 self.assertAlmostEqual(456, v.get())
/third_party/python/Lib/ctypes/test/
Dtest_byteswap.py138 self.assertAlmostEqual(s.value, math.pi, places=6)
140 self.assertAlmostEqual(s.value, math.pi, places=6)
143 self.assertAlmostEqual(s.value, math.pi, places=6)
Dtest_structures.py550 self.assertAlmostEqual(result, expected, places=6)
552 self.assertAlmostEqual(s.data[0], 3.14159, places=6)
553 self.assertAlmostEqual(s.data[1], 2.71828, places=6)
554 self.assertAlmostEqual(s.more_data[0], -3.0, places=6)
555 self.assertAlmostEqual(s.more_data[1], -2.0, places=6)
Dtest_callbacks.py24 self.assertAlmostEqual(result, arg, places=5)
32 self.assertAlmostEqual(result, arg, places=5)
/third_party/benchmark/tools/gbench/
Dreport.py1115 unittest_instance.assertAlmostEqual(
1118 unittest_instance.assertAlmostEqual(
1135 unittest_instance.assertAlmostEqual(m1['time'], m2['time'], places=4)
1136 unittest_instance.assertAlmostEqual(m1['cpu'], m2['cpu'], places=4)
/third_party/protobuf/python/google/protobuf/internal/
Ddescriptor_test.py272 self.assertAlmostEqual(12.3456789, message_options.Extensions[
274 self.assertAlmostEqual(1.234567890123456789, message_options.Extensions[
288 self.assertAlmostEqual(12, message_options.Extensions[
290 self.assertAlmostEqual(154, message_options.Extensions[
296 self.assertAlmostEqual(-12, message_options.Extensions[
298 self.assertAlmostEqual(-154, message_options.Extensions[
/third_party/python/Doc/library/
D2to3.rst180 ``failUnlessAlmostEqual(a, b)`` :meth:`assertAlmostEqual(a, b)
181 <unittest.TestCase.assertAlmostEqual>`
182 ``assertAlmostEquals(a, b)`` :meth:`assertAlmostEqual(a, b)
183 <unittest.TestCase.assertAlmostEqual>`

12