Buckets:

download
raw
1.57 kB
# std
import os
# external
from fastapi.testclient import TestClient
import pytest
# molar
from molar.backend.main import app
@pytest.fixture(scope="module")
def client():
return TestClient(app)
@pytest.fixture(scope="module")
def molar_main_headers(client):
out = client.post(
"/api/v1/login/access-token",
data={
"username": os.getenv("MOLAR_SUPERUSER") or "test@molar.tooth",
"password": os.getenv("MOLAR_PASSWORD") or "tooth",
},
)
token = out.json()["access_token"]
headers = {"Authorization": f"Bearer {token}"}
return headers
@pytest.fixture(scope="class")
def new_database_headers(client, molar_main_headers):
out = client.post(
"/api/v1/database/request",
json={
"superuser_fullname": "Test User",
"superuser_email": "test@firstuser.com",
"superuser_password": "asdf",
"database_name": "test_database",
"alembic_revisions": ["compchem@head"],
},
)
assert out.status_code == 200
out = client.put(
"/api/v1/database/approve/test_database", headers=molar_main_headers
)
assert out.status_code == 200
out = client.post(
"/api/v1/login/access-token?database_name=test_database",
data={"username": "test@firstuser.com", "password": "asdf"},
)
token = out.json()["access_token"]
yield {"Authorization": f"Bearer {token}"}
out = client.delete("/api/v1/database/test_database", headers=molar_main_headers)
assert out.status_code == 200

Xet Storage Details

Size:
1.57 kB
·
Xet hash:
9a5c6cdd9323b553e8ed0f9b6a17590a80ff6661b9948abdf1554029c18abe1a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.