Below is my code : and need to test myfunction(). and how to create mock function of file.
def myfunction(self):
with tempfile.NamedTemporaryFile() as tf:
f.seek(0)
tf.write(f.read())
tf.flush()
ocr_content_dict = self.ocr.ocr_document(tf.name, mimetype) or ''
ocr_content = ocr_content_dict['content']