

@mock.patch.object(er, 'check_failed_test_ids_for_job', return_value=True)
def test_classify_with_test_id_filter_match(self, mock_id_check):
    c = er.Classifier('./elastic_recheck/tests/unit/queries_with_filters')
    es_mock = mock.patch.object(c.es, 'search', return_value=[1, 2, 3])
    es_mock.start()
    self.addCleanup(es_mock.stop)
    res = c.classify(1234, 1, 'fake')
    self.assertEqual(res, ['1234567'], ("classify() returned %s when it should have returned a list with one bug id: '1234567'" % res))

dataset/ETHPy150Open openstack-infra/elastic-recheck/elastic_recheck/tests/unit/test_elastic_recheck.py TestSubunit2sqlCrossover.test_classify_with_test_id_filter_match/original