コード例 #1
0
ファイル: test_s3_client.py プロジェクト: jmuhlich/indra
def test_put_full_text():
    full_text = 'test_put_full_text'
    pmid_test = 'PMID000test1'
    s3_client.put_full_text(pmid_test, full_text, full_text_type='pmc_oa_txt')
    # Get the full text back
    (content, content_type) = s3_client.get_full_text(pmid_test)
    assert content == full_text
    assert content_type == 'pmc_oa_txt'
    assert unicode_strs(content)
コード例 #2
0
def test_put_full_text():
    full_text = 'test_put_full_text'
    pmid_test = 'PMID000test1'
    s3_client.put_full_text(pmid_test, full_text, full_text_type='pmc_oa_txt')
    # Get the full text back
    (content, content_type) = s3_client.get_full_text(pmid_test)
    assert content == full_text
    assert content_type == 'pmc_oa_txt'
    assert unicode_strs(content)
コード例 #3
0
ファイル: test_s3_client.py プロジェクト: jmuhlich/indra
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'
コード例 #4
0
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'