Source code for tests.sensitivity_calculator.test_routes

"""
Unit tests for the sensitivity_calculator.routes module
At the moment, test the subarrays REST interface.
"""

import pytest
from sensitivity_calculator import app
from flask import json


@pytest.fixture
def client():
    """As explained in the Flask documentation: https://flask.palletsprojects.com/en/1.1.x/testing/"""
    app.config["TESTING"] = True
    with app.test_client() as client:
        yield client


[docs]def test_subarrays_list(client): """Test the subarrays entry point.""" rv = client.get("/subarrays") data = json.loads(rv.data) # Check that the placeholder subarray entered in AT2-606 is removed when necessary assert ["core", "custom", "extended", "full"] == data