From 3a4d56a58ddfd42c53f36950dfe4f6c0298c4278 Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Mon, 9 Sep 2019 17:02:43 +0200 Subject: [PATCH] SW-815: check for integer types. --- .../TaskPrescheduler/test/test_taskprescheduler.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py b/SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py index 85a39a65784..d3d7fdc5f44 100755 --- a/SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py +++ b/SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py @@ -292,7 +292,14 @@ class PreschedulerTest(unittest.TestCase): spec = Specification(self.otdbrpc_mock, self.momrpc_mock, self.radbrpc_mock) spec.internal_dict = self.test_specification cobalt_settings = calculateCobaltSettings(spec) + + # beware! assertEqual succeeds for a comparison between 42.0 and 42 + # but for lofar specs it is essential that some values are int + # so, check specifically for those! self.assertEqual(cobalt_settings, self.test_cobalt_settings) + self.assertEqual(int, type(cobalt_settings['blockSize'])) + self.assertEqual(int, type(cobalt_settings['nrBlocks'])) + self.assertEqual(int, type(cobalt_settings['nrSubBlocks'])) @mock.patch("lofar.common.util.waitForInterrupt") @mock.patch("lofar.messaging.messagebus.BusListener.start_listening") -- GitLab