def test_simple(self):
_file_meta = file_meta.Subscriber(test_helper.get_mock_pipeline([]))
response = json.dumps({'Content-Type': 'image/jpeg'}).encode('utf-8')
_file_meta.setup({
'data_root': 'local_data',
'code_root': '.',
'worker_id': 1,
'host': 'mock',
helper.INJECTOR: test_helper.MockInjector(response)
})
doc = document.get_document('mock.txt')
_file_meta.consume(doc, BytesIO(b'mock'))
expected = 'picture'
actual = doc.doctype
self.assertEqual(expected, actual)
评论列表
文章目录