import os
import requests

BASE = os.environ.get('BASE_URL', 'http://127.0.0.1:8001')


def test_health():
    r = requests.get(f"{BASE}/api/health", timeout=5)
    assert r.status_code == 200
    body = r.json()
    assert 'status' in body and body['status'] == 'ok'


def test_info():
    r = requests.get(f"{BASE}/api/info", timeout=5)
    assert r.status_code == 200
    body = r.json()
    assert 'app' in body
