def test_mk_lifecycle_config_no_onstart_or_oncreate(self, prj_no_vpc): notebook_lifecycle_cfg_no_scripts = cli_utils.mk_lifecycle_config( prj_no_vpc, "notebook-1") assert notebook_lifecycle_cfg_no_scripts == { "NotebookInstanceLifecycleConfigName": "modelling-project-" "notebook-1-lifecycle-config" }
def test_mk_lifecycle_config(self, prj): notebook_lifecycle_cfg = cli_utils.mk_lifecycle_config( prj, "notebook-1") assert (base64.b64decode(notebook_lifecycle_cfg["OnStart"][0] ["Content"]) == on_start_fixture()) assert notebook_lifecycle_cfg == { "NotebookInstanceLifecycleConfigName": "modelling-project-" "notebook-1-lifecycle-config", "OnStart": [{ "Content": base64.b64encode(on_start_fixture()).decode("utf-8") }], }
def test_mk_lifecycle_config_on_create(self, prj): notebook_lifecycle_cfg = cli_utils.mk_lifecycle_config( prj, "notebook-1") assert (base64.b64decode(notebook_lifecycle_cfg["OnCreate"][0] ["Content"]) == on_create_fixture())