Exemplo n.º 1
0
def test_keep(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=False)
    assert len(secret_two.list()) == 1
    secret.delete('test_1')
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def test_get(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 secret.get('test_1') == 'bar'
    secret.delete('test_1')
Exemplo n.º 4
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