From a07dd39f30d5b1f07a0f882514db84c0100814c7 Mon Sep 17 00:00:00 2001 From: ujjwal-ab Date: Thu, 27 Jul 2023 14:27:48 +0530 Subject: [PATCH] chore: refactor code --- scripts/configGenerator.py | 4 ++-- test/test_configGenerator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/configGenerator.py b/scripts/configGenerator.py index 5dd8541be..92213a58a 100644 --- a/scripts/configGenerator.py +++ b/scripts/configGenerator.py @@ -60,6 +60,7 @@ def updateUiConfig(field): db_config['config']['destConfig']['defaultConfig'][-1]) db_config = json.dumps(db_config) + ui_config = json.dumps(ui_config) return {'db_config':db_config, 'ui_config': ui_config} @@ -80,11 +81,10 @@ def updateUiConfig(field): file_path = f'src/configurations/destinations/{data["displayName"]}/ui-config.json' - ui_config = json.dumps(configData['ui_config']) directory = os.path.dirname(file_path) if not os.path.exists(directory): os.makedirs(directory) with open(file_path, 'w') as file: # Write the new content - file.write(ui_config) + file.write(configData['ui_config']) diff --git a/test/test_configGenerator.py b/test/test_configGenerator.py index 45faf049b..1964e7f77 100644 --- a/test/test_configGenerator.py +++ b/test/test_configGenerator.py @@ -23,7 +23,7 @@ class TestConfigGenerator(unittest.TestCase): def test_config_generator(self): result = generateConfigs(input_data) self.assertEqual(result['db_config'], json.dumps(db_config)) - self.assertEqual(json.dumps(result['ui_config']), json.dumps(ui_config)) + self.assertEqual(result['ui_config'], json.dumps(ui_config)) if __name__ == '__main__': unittest.main()