def test_loads_areas_from_library():
    assert [(area.id, area.name)
            for area in sorted(broadcast_area_libraries.get('ctry19'))] == [
                ('ctry19-E92000001', 'England'),
                ('ctry19-N92000002', 'Northern Ireland'),
                ('ctry19-S92000003', 'Scotland'),
                ('ctry19-W92000004', 'Wales'),
            ]
コード例 #2
0
def test_loads_areas_from_libraries(id):
    assert (
        broadcast_area_libraries.get('ctry19').get(id)
    ) == (
        broadcast_area_libraries.get_areas(id)[0]
    )
コード例 #3
0
def test_examples():
    countries = broadcast_area_libraries.get('ctry19').get_examples()
    assert countries == 'England, Northern Ireland, Scotland and Wales'

    wards = broadcast_area_libraries.get('wd20-lad20-ctyua19').get_examples()
    assert wards == 'Aberdeen City, Aberdeenshire, Adur and 391 more…'
コード例 #4
0
def test_polygons_are_enclosed():
    england = broadcast_area_libraries.get('ctry19').get('ctry19-E92000001')

    first_polygon = england.polygons.as_coordinate_pairs_lat_long[0]
    assert first_polygon[0] != first_polygon[1] != first_polygon[2]
    assert first_polygon[0] == first_polygon[-1]