예제 #1
0
def test_data_files_are_valid(data_files):
    for data in data_files():
        assert isinstance(PlaceSchema().load(data), Place)
예제 #2
0
def ma_precincts():
    with open("data/ma-precincts.yml") as f:
        ma_yaml = yaml.safe_load(f)
    return PlaceSchema().load(ma_yaml)
예제 #3
0
def test_data_files_are_valid(data_files):
    for data in data_files():
        assert all(
            isinstance(units, Units)
            for units in PlaceSchema().load(data)["units"])
예제 #4
0
def lowell():
    with open("data/lowell.yml") as f:
        lowell_yaml = yaml.safe_load(f)
    return PlaceSchema().load(lowell_yaml)
예제 #5
0
def mass():
    with open("data/massachusetts.yml") as f:
        ma_yaml = yaml.safe_load(f)
    return PlaceSchema().load(ma_yaml)