Exemple #1
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')
Exemple #2
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")
Exemple #3
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
Exemple #4
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")