def test_data_files_are_valid(data_files): for data in data_files(): assert isinstance(PlaceSchema().load(data), Place)
def ma_precincts(): with open("data/ma-precincts.yml") as f: ma_yaml = yaml.safe_load(f) return PlaceSchema().load(ma_yaml)
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"])
def lowell(): with open("data/lowell.yml") as f: lowell_yaml = yaml.safe_load(f) return PlaceSchema().load(lowell_yaml)
def mass(): with open("data/massachusetts.yml") as f: ma_yaml = yaml.safe_load(f) return PlaceSchema().load(ma_yaml)