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 !719
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#733183
external
|
SlapOS-Master.UnitTest-Master |
02:35:08
|
||||||
passed |
#733151
external
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:28:50
|
||||||
passed |
#733192
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:40:50
|
||||||
passed |
#733165
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:43:01
|
||||||