def test_delete(tmp_path): path_srv_root = os.path.join(str(tmp_path), user_folder_name) os.environ["JUPYTER_SERVER_ROOT"] = path_srv_root secret = Secret(clean=True) secret.add('test_1', 'bar') assert len(secret.list()) == 1 secret.delete('test_1') assert len(secret.list()) == 0
def test_clean(tmp_path): path_srv_root = os.path.join(str(tmp_path), user_folder_name) os.environ["JUPYTER_SERVER_ROOT"] = path_srv_root secret = Secret(clean=True) secret.add("test_1", "bar") secret_two = Secret(clean=True) assert len(secret_two.list()) == 0
def test_init(tmp_path): path_srv_root = os.path.join(str(tmp_path), user_folder_name) os.environ["JUPYTER_SERVER_ROOT"] = path_srv_root secret = Secret(clean=True) assert os.path.exists(os.path.join(path_srv_root, '.naas')) assert len(secret.list()) == 0