示例#1
0
 def test_unindex_objects(self, get_es_mock):
     model = MagicMock()
     unindex_objects(model, [1, 2, 3], 'foo')
     ok_(model.unindex.called)
     model.assert_has_calls([
         call.unindex(es=get_es_mock(), public_index='foo', id=1),
         call.unindex(es=get_es_mock(), public_index='foo', id=2),
         call.unindex(es=get_es_mock(), public_index='foo', id=3)])
示例#2
0
 def test_unindex_objects(self, get_es_mock):
     mapping_type = MagicMock()
     unindex_objects(mapping_type, [1, 2, 3], 'foo')
     ok_(mapping_type.unindex.called)
     mapping_type.assert_has_calls([
         call.unindex(1, es=get_es_mock(), public_index='foo'),
         call.unindex(2, es=get_es_mock(), public_index='foo'),
         call.unindex(3, es=get_es_mock(), public_index='foo')])
示例#3
0
 def test_unindex_objects(self, get_es_mock):
     mapping_type = MagicMock()
     unindex_objects(mapping_type, [1, 2, 3], 'foo')
     ok_(mapping_type.unindex.called)
     mapping_type.assert_has_calls([
         call.unindex(1, es=get_es_mock(), public_index='foo'),
         call.unindex(2, es=get_es_mock(), public_index='foo'),
         call.unindex(3, es=get_es_mock(), public_index='foo')])
示例#4
0
 def test_unindex_objects(self, get_es_mock):
     model = MagicMock()
     unindex_objects(model, [1, 2, 3], 'foo')
     ok_(model.unindex.called)
     model.assert_has_calls([
         call.unindex(es=get_es_mock(), public_index='foo', id=1),
         call.unindex(es=get_es_mock(), public_index='foo', id=2),
         call.unindex(es=get_es_mock(), public_index='foo', id=3)
     ])