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 !136 slapos.core!719
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
failed |
#737055
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:46:12
|
||||||
failed |
#736981
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
02:02:04
|
||||||
failed |
#736934
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:28:52
|
||||||
failed |
#736842
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:26:49
|
||||||
failed |
#736735
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:40:07
|
||||||
failed |
#736695
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:28:45
|
||||||
failed |
#736646
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:29:45
|
||||||
failed |
#736585
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:27:33
|
||||||
failed |
#736391
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:31:32
|
||||||
failed |
#736352
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:28:16
|
||||||
failed |
#736300
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:43:06
|
||||||
failed |
#736257
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:36:27
|
||||||
failed |
#736134
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
06:14:22
|
||||||
failed |
#735777
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:30:12
|
||||||
failed |
#735432
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:45:02
|
||||||
failed |
#735350
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:51:38
|
||||||
failed |
#734933
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:32:43
|
||||||
failed |
#734507
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:31:38
|
||||||
failed |
#734437
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:32:43
|
||||||
failed |
#734269
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:48:08
|
||||||
failed |
#733786
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
02:06:24
|
||||||
failed |
#733381
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
04:42:32
|
||||||
failed |
#733243
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:32:38
|
||||||
failed |
#733198
external
retried
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:40:50
|
||||||