

@patch('openelex.base.datasource.elec_api.find')
def test_mappings_filtered_by_year(self, mock_elec_find):
    mock_elec_find.return_value = md_data['objects']
    mappings = self.datasource.mappings(2000)
    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])
    self.assertEqual(len(self), 50)

dataset/ETHPy150Open openelections/openelections-core/openelex/tests/test_md_datasource.py TestMappings.test_mappings_filtered_by_year/VarMisuse@87/237 `mappings`->`self`