def test_root_access():
    root = ZEOConfWrapper(
        conf_path=tmp_context_name("zeo_client.conf"),
    )

    assert PROJECT_KEY in root
    assert list(root.keys()) == [PROJECT_KEY]
def random_archive_comm(monkeypatch):
    monkeypatch.setattr(
        storage.structures.db.db_archive,
        "ARCHIVE_DIR",
        tempfile.mkdtemp(dir=tmp_context_name())
    )

    return Archive(
        isbn=FAKER.ssn(),
        uuid=str(uuid.uuid4()),
        aleph_id=random.randint(9999, 99999999),
        b64_data=b64_zip_file(),
    )
Exemplo n.º 3
0
def _create_alt_settings():
    alt_settings = {
        "ZCONF_PATH": tmp_context_name(),
        "ZEO_SERVER_PATH": tmp_context_name("zeo.conf"),
        "ZEO_CLIENT_PATH": tmp_context_name("zeo_client.conf"),
        "PUBLIC_DIR": tmp_context_name(),
        "PRIVATE_DIR": tmp_context_name(),
        "ARCHIVE_DIR": tmp_context_name(),
        "PRIVATE_INDEX": False,
        "PRIVATE_INDEX_PASSWORD": "******"
    }

    with tempfile.NamedTemporaryFile(delete=False) as f:
        f.write(json.dumps(alt_settings))
        return f.name
Exemplo n.º 4
0
def client_conf_path(zeo):
    return tmp_context_name("zeo_client.conf")
def database_handler():
    return DatabaseHandler(
        conf_path=tmp_context_name("zeo_client.conf"),
        project_key=PROJECT_KEY,
    )
def zeo_conf_wrapper():
    return ZEOConfWrapper(
        conf_path=tmp_context_name("zeo_client.conf"),
        project_key=PROJECT_KEY,
    )
def status_handler():
    return StatusHandler(
        conf_path=tmp_context_name("zeo_client.conf"),
        project_key="key",
    )
Exemplo n.º 8
0
def server_conf_path(zeo):
    return tmp_context_name("zeo.conf")
Exemplo n.º 9
0
def client_conf_path(zeo):
    return tmp_context_name("zeo_client.conf")