Code Duplication    Length = 12-12 lines in 2 locations

tests/test_MongoRepo.py 2 locations

@@ 258-269 (lines=12) @@
255
        self.fileFactory.fromProvenance.assert_any_call('r1')
256
        self.fileFactory.fromProvenance.assert_any_call('r2')
257
258
    def test_Query_for_ALL_field(self):
259
        self.db.provenance.distinct.return_value = ['r1','r2']
260
        self.setupRepo()
261
        q = Mock()
262
        field1 = Mock()
263
        field1.name = 'color'
264
        field1.all = True
265
        q.getFields.return_value = [field1]
266
        out = self.repo.inquire(q)
267
        self.db.provenance.distinct.assert_called_with('color')
268
        self.fileFactory.fromProvenance.assert_any_call('r1')
269
        self.fileFactory.fromProvenance.assert_any_call('r2')
270
271
272
@@ 229-240 (lines=12) @@
226
        out = self.repo.getSeries(img)
227
        self.listener.unknownFile.assert_called_with('seriesuid: 123abc')
228
229
    def test_Query(self):
230
        self.db.provenance.find.return_value = ['record1']
231
        self.setupRepo()
232
        q = Mock()
233
        field1 = Mock()
234
        field1.name = 'color'
235
        field1.value = 'red'
236
        field1.all = False
237
        q.getFields.return_value = [field1]
238
        out = self.repo.inquire(q)
239
        self.db.provenance.find.assert_called_with({'color':'red'})
240
        self.fileFactory.fromProvenance.assert_called_with('record1')
241
242
    def test_Ensures_text_index_for_search(self):
243
        self.setupRepo()