def test_dont_detect_docx_extension(fakefile, filename): fakefile.name = filename handler = DocxHandler() assert handler.detect(fakefile) is False
def test_detect_nondocx(fakefile): fakefile.name = 'not_doc.odt' handler = DocxFileHandler() assert handler.detect(fakefile) is False
def test_detect_docx_extension(fakefile): fakefile.name = 'file.docx' handler = DocxHandler() assert handler.detect(fakefile) is True
def test_detect_docx(fakefile): # set file's name fakefile.name = 'mydoc.docx' handler = DocxFileHandler() assert handler.detect(fakefile) is True