def _check_measurements(self, measurements, type):
    values = {'single': {Measurement.HOLDINGS: 41932, Measurement.PUBLISHED_EDITIONS: 1}, 'multi': {Measurement.HOLDINGS: 5976, Measurement.PUBLISHED_EDITIONS: 160}}
    assert (len(measurements) == 2)
    ([holdings], [editions]) = [[x for x in measurements if (y in x.quantity_measured)] for y in ['holdings', 'editions']]
    for m in [holdings, editions]:
        assert isinstance(m, MeasurementData)
        expected_value = values[type][m.quantity_measured]
        assert (m.weight == 1)
        assert (m.value == expected_value)
def _check_measurements(self, measurements, type):
    values = {'single': {Measurement.HOLDINGS: 41932, Measurement.PUBLISHED_EDITIONS: 1}, 'multi': {Measurement.HOLDINGS: 5976, Measurement.PUBLISHED_EDITIONS: 160}}
    assert (len(measurements) == 2)
    ([holdings], [editions]) = [[x for x in measurements if (y in x.quantity_measured)] for y in ['holdings', 'editions']]
    for m in [holdings, editions]:
        assert isinstance(m, MeasurementData)
        expected_value = values[type][m.quantity_measured]
        assert (m.weight == 1)
        assert (m.value == expected_value)