def test_put_abstract(): abstract = 'test_put_abstract' pmid_test = 'PMID000test2' s3_client.put_abstract(pmid_test, abstract) # Get the abstract back (content, content_type) = s3_client.get_full_text(pmid_test) assert content == abstract assert content_type == 'abstract' assert unicode_strs(content)
def test_get_upload_content(): pmid_s3_no_content = 'PMID000foobar' (ct, ct_type) = s3_client.get_upload_content(pmid_s3_no_content) assert ct == None assert ct_type == None pmid_s3_abstract_only = 'PMID000test4' s3_client.put_abstract(pmid_s3_abstract_only, 'foo') (ct, ct_type) = s3_client.get_upload_content(pmid_s3_abstract_only) assert ct == 'foo' assert ct_type == 'abstract' pmid_s3_fulltext = 'PMID000test5' s3_client.put_full_text(pmid_s3_fulltext, 'foo', full_text_type='txt') (ct, ct_type) = s3_client.get_upload_content(pmid_s3_fulltext) assert ct == 'foo' assert ct_type == 'txt'
def test_get_upload_content(): pmid_s3_no_content = 'PMID000foobar' (ct, ct_type) = s3_client.get_upload_content(pmid_s3_no_content) assert ct is None assert ct_type is None pmid_s3_abstract_only = 'PMID000test4' s3_client.put_abstract(pmid_s3_abstract_only, 'foo') (ct, ct_type) = s3_client.get_upload_content(pmid_s3_abstract_only) assert ct == 'foo' assert ct_type == 'abstract' pmid_s3_fulltext = 'PMID000test5' s3_client.put_full_text(pmid_s3_fulltext, 'foo', full_text_type='txt') (ct, ct_type) = s3_client.get_upload_content(pmid_s3_fulltext) assert ct == 'foo' assert ct_type == 'txt'