From 5260570c953ef8be61ccd3f1ee908f151d64e801 Mon Sep 17 00:00:00 2001 From: Ilya Popov Date: Thu, 10 Nov 2016 21:09:06 +0300 Subject: [PATCH] Fix removes date_time items from dictionaries Some functional tests fail because they assert dictionaries with date/time items. For example, test_environment_template_create checks that dictionary env_template exists in env_template_list dicrionary list. All mentioned dictionaries have date/time items with keys 'Created' and 'Updated'. If the system, where functional tests are executed will be quite slow - time in these dictionaries could differ. This behavior will result corresponding test to fail even if all tasks will be executed successfully because time in dictionaries for 'Created' and 'Updated' keys will differ and assert will fail Removing the date/time items from dictionaries will help to successfully pass functional tests Closes-Bug: #1626733 Change-Id: I859eb7024619c8718411e295fe7cb93c6b8972eb --- muranoclient/tests/functional/cli/test_murano.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/muranoclient/tests/functional/cli/test_murano.py b/muranoclient/tests/functional/cli/test_murano.py index 0419fb32..7bbd8cbe 100644 --- a/muranoclient/tests/functional/cli/test_murano.py +++ b/muranoclient/tests/functional/cli/test_murano.py @@ -372,6 +372,12 @@ class EnvTemplateMuranoSanityClientTest(utils.CLIUtilsTestBase): 'TestMuranoSanityEnvTemp') env_template_list = self.listing('env-template-list') + # Deleting dates from dictionaries to skip it in assert + map(lambda x: x.pop('Updated', None), + env_template_list + [env_template]) + map(lambda x: x.pop('Created', None), + env_template_list + [env_template]) + self.assertIn(env_template, env_template_list) def test_environment_template_delete(self):