def test_get_file_list_and_bad_number_work(savefile_tempdir): compressed_file = PATH + 'Bad_Number_Archive.zip' PATHstr = savefile_tempdir file_list = df.get_file_list(compressed_file, PATHstr + '/', '123') condition = True for file in file_list[0]: document_id = df.get_document_id(file) if file.startswith('doc.') and \ df.document_id_ending_is_number(document_id) \ and df.document_id_beginning_is_letter(document_id): pass else: condition = False assert condition is False
def test_get_document_id_other_special(): assert df.get_document_id('doc.FDA-2018-N-0073-0002.json') == \ 'FDA-2018-N-0073-0002'
def test_get_document_id_special(): assert df.get_document_id('doc.AHRQ_FRDOC_0001-0036.json') == \ 'AHRQ_FRDOC_0001-0036'
def test_get_document_id(): assert df.get_document_id('doc.mesd-2018-234234-0001.json') == \ 'mesd-2018-234234-0001'