Ejemplo n.º 1
0
def test_compare_districts_overfill():
    expected = {"A": 1}
    actual = {'A': [{'id': 'ocd-person/1', 'name': 'Anne'},
                    {'id': 'ocd-person/2', 'name': 'Bob'}]}
    e = compare_districts({"upper": expected}, {"upper": actual})
    assert len(e) == 1
    assert 'Anne' in e[0]
    assert 'Bob' in e[0]
Ejemplo n.º 2
0
def test_compare_districts_overfill():
    expected = {"A": 1}
    actual = {
        "A": [{
            "id": "ocd-person/1",
            "name": "Anne"
        }, {
            "id": "ocd-person/2",
            "name": "Bob"
        }]
    }
    e = compare_districts({"upper": expected}, {"upper": actual})
    assert len(e) == 1
    assert "Anne" in e[0]
    assert "Bob" in e[0]
Ejemplo n.º 3
0
def test_compare_districts(expected, actual, errors):
    e = compare_districts({"upper": expected}, {"upper": actual})
    assert len(e) == errors
Ejemplo n.º 4
0
def test_compare_districts(expected, actual, errors, warnings):
    e, w = compare_districts({"upper": expected}, {"upper": actual})
    assert len(e) == errors
    assert len(w) == warnings