

@patch('openelex.base.datasource.elec_api.find')
def test_mappings_default(self, mock_elec_find):
    mock_elec_find.return_value = md_data['objects']
    mappings = self.datasource.mappings()
    expected_2000 = {
        'election': 'md-2000-11-07-general',
        'generated_filename': '20001107__md__general__state_legislative.csv',
        'name': 'State Legislative Districts',
        'ocd_id': 'ocd-division/country:us/state:md/sldl:all',
        'raw_url': 'http://www.elections.state.md.us/elections/2000/election_data/State_Legislative_Districts_General_2000.csv',
    }
    self.assertDictEqual(expected_2000, mappings[0])
    expected_2012 = {
        'election': 'md-2012-04-03-primary',
        'generated_filename': '20120403__md__republican__primary__baltimore_city.csv',
        'name': 'Baltimore City',
        'ocd_id': 'ocd-division/country:us/state:md/place:baltimore',
        'raw_url': 'http://www.elections.state.md.us/elections/2012/election_data/Baltimore_City_County_Republican_2012_Primary.csv',
    }
    self.assertDictEqual(expected_2012, mappings[(- 1)])

dataset/ETHPy150Open openelections/openelections-core/openelex/tests/test_md_datasource.py TestMappings.test_mappings_default/original