def test_database_party_names(): db = load_db("tests/fixtures/data") assert db.party_names == { "a_party": "A Party", "b.party": "B Party", "s-party": "Structured Party", }
def test_database_party_colors(): db = load_db("tests/fixtures/data") assert db.party_colors == { "a_party": "#ff0000", "b.party": "#00ff00", "s-party": "#000000", }
def client(): db = load_db("tests/fixtures/data") app = create_app(db) with app.test_client() as client: yield client
from wahlprogramme import create_app from wahlprogramme.database import load_db # load database db = load_db("data/", txt=False) app = create_app(db)
def test_database_meta_data(): db = load_db("tests/fixtures/data") assert "a_party" in db.meta.parties assert db.meta.parties["a_party"].color == "#ff0000" assert db.meta.parties["a_party"].name == "A Party"
def test_database_parties(): db = load_db("tests/fixtures/data") assert "a_party" in db.parties assert "b.party" in db.parties
def test_database_years(): db = load_db("tests/fixtures/data") assert db.years == ["1000", "1001"]
def test_load_db_only_xml(): db = load_db("tests/fixtures/data", txt=False) assert type(db) == Database assert type(db.get("1001")) == Year assert db.get("1001").get("a_party") is None assert type(db.get("1001").get("s-party")) == StructuredText
def test_load_db(): db = load_db("tests/fixtures/data") assert type(db) == Database assert type(db.get("1000")) == Year assert type(db.get("1001")) == Year