tests: use `assertAlmostEqual` for float comparison
Floating point arithmetics often lead to unsignificant differences between expected and computed values (this is the typical example of `0.1 + 0.2 != 0.3`). Because of this, some tests using `assertEqual` to compare two floats were failing. The Python method [`assertAlmostEqual`](https://docs.python.org/2.7/library/unittest.html#unittest .TestCase.assertAlmostEqual) can prevent these issues by comparing values up to the seventh decimal place. To find all occurences, two RegExp were ran on all files of the `tests/` folder: `assertEquals?(\\(.+, [0-9]+\\.[0-9]+\\))` and `assertEquals?(\\([0-9]+\\.[0-9]+)`. /cc @xavier_thompson @tomo /reviewed-by @jerome /reviewed-on nexedi/slapos.core!719
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#738263
external
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
03:09:11
|
||||||
failed |
#737780
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
00:29:47
|
||||||
failed |
#737749
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
00:30:48
|
||||||
failed |
#737360
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
02:08:45
|
||||||
failed |
#737101
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
03:17:53
|
||||||
failed |
#736517
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
02:41:08
|
||||||
passed |
#736097
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
00:56:44
|
||||||
passed |
#735250
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
03:52:47
|
||||||
failed |
#733315
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
00:42:18
|
||||||
passed |
#733212
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
00:38:58
|
||||||
passed |
#733150
external
retried
|
SlapOS.Eggs.UnitTest-Titouan.TestRunner.Duck |
02:06:43
|
||||||