def test_struct_out(self): from resource_management.libraries.script import Script configs_path = os.path.join(RMFTestCase._getSrcFolder(), "test/python/stacks", self.STACK_VERSION, "configs") script = Script() script.stroutfile = os.path.join(configs_path, "structured-out-status.json") script.load_structured_out() self.assertFalse("version" in script.structuredOut)
def test_struct_out(self): from resource_management.libraries.script import Script configs_path = os.path.join(RMFTestCase._getSrcFolder(), "test/python/stacks", self.STACK_VERSION, "configs") script = Script() script.stroutfile = os.path.join(configs_path, "structured-out-status.json") script.load_structured_out() self.assertFalse("version" in script.structuredOut)
def test_bad_struct_out(self): from resource_management.libraries.script import Script from resource_management.core.logger import Logger configs_path = os.path.join(RMFTestCase.get_src_folder(), "test/python/stacks", self.STACK_VERSION, "configs") Logger.initialize_logger() script = Script() script.stroutfile = os.path.join(configs_path, "structured-out-status-bad.json") script.load_structured_out() self.assertTrue(script.structuredOut == {})
def test_bad_struct_out(self, logger_mock): from resource_management.libraries.script import Script logger_mock.warn = MagicMock() configs_path = os.path.join(RMFTestCase.get_src_folder(), "test/python/stacks", self.STACK_VERSION, "configs") script = Script() script.stroutfile = os.path.join(configs_path, "structured-out-status-bad.json") script.load_structured_out() self.assertTrue(logger_mock.warn.called) self.assertTrue(script.structuredOut == {})