def test_convert_from_string(self):
"""Convert from string"""
self.set_original_document_from_string('#1')
response = self.app.post('/convert/',
buffered=True,
content_type='multipart/form-data',
data={
'document': self.original_document_content_string,
'from': 'md',
'to': 'rst'
})
destination_document = response.data
assert '200' in response.status
assert 'octet-stream' in response.content_type
assert magic.from_buffer(destination_document, mime=True) == 'text/plain'
assert os.listdir(app.config['CONVERSION_FOLDER']) == []
评论列表
文章目录