import pytest

def test_get_materials(client, db_mock):
    db_mock.execute_query.return_value = [
        {"id": 1, "name_en": "PLA", "desc_en": "Standard", "price_per_cm3": 0.05, "is_active": True}
    ]
    
    response = client.get("/materials")
    assert response.status_code == 200
    assert len(response.json()) == 1
    assert response.json()[0]["name_en"] == "PLA"

def test_admin_get_materials_forbidden(client):
    # Testing RBAC without token
    response = client.get("/admin/materials")
    assert response.status_code == 401 # Should actually be 401 if no token provided at all
