def test_lookup_with_sys_path(self): config = Config({ "sys_path": "stacker/tests", "lookups": { "custom": "fixtures.mock_lookups.handler"}}) load(config) self.assertTrue(callable(LOOKUP_HANDLERS["custom"]))
def test_hook_with_sys_path(self): config = Config({ "namespace": "test", "sys_path": "stacker/tests", "pre_build": [ { "data_key": "myHook", "path": "fixtures.mock_hooks.mock_hook", "required": True, "args": { "value": "mockResult"}}]}) load(config) context = Context(config=config) stage = "pre_build" handle_hooks(stage, context.config[stage], "mock-region-1", context) self.assertEqual("mockResult", context.hook_data["myHook"]["result"])
def test_load_adds_sys_path(self): config = Config({"sys_path": "/foo/bar"}) load(config) self.assertIn("/foo/bar", sys.path)
def test_load_register_custom_lookups(self): config = Config({ "lookups": { "custom": "importlib.import_module"}}) load(config) self.assertTrue(callable(LOOKUP_HANDLERS["custom"]))