def test_a(self): """Test when there are no ESF patterns.""" area = Mock(data_set="don't care") suitable_measures = \ SuitableMeasures(SimpleSuitableMeasureInfoFactory(), SimplePatternMeasuresRetriever({}), SimplePatternMatcher()) self.assertEqual([], suitable_measures.get(area))
def test_c(self): """Test when there is a single ESF pattern that is suitable.""" area = Mock(data_set="don't care") suitable_measures = \ SuitableMeasures(SimpleSuitableMeasureInfoFactory(), SimplePatternMeasuresRetriever({Mock(pattern='XX-------'): ['dummy measure']}), SimplePatternMatcher()) suitable_measures._get_area_pattern = (lambda a: 'XX-------') self.assertEqual(["dummy measure"], suitable_measures.get(area))