Example #1
0
def process_pmc(pmc_id):
    xml_str = pmc_client.get_xml(pmc_id)
    with tempfile.NamedTemporaryFile() as fh:
        fh.write(xml_str)
        fh.flush()
        rp = process_nxml(fh.name)
    return rp
Example #2
0
def process_pmc(pmc_id):
    if pmc_id.upper().startswith('PMC'):
        pmc_id = pmc_id[3:]
    xml_str = pmc_client.get_xml(pmc_id)
    if xml_str is None:
        return None
    with tempfile.NamedTemporaryFile() as fh:
        fh.write(xml_str)
        fh.flush()
        rp = process_nxml(fh.name)
    return rp
Example #3
0
def process_pmc(pmc_id):
    if pmc_id.upper().startswith('PMC'):
        pmc_id = pmc_id[3:]
    xml_str = pmc_client.get_xml(pmc_id)
    if xml_str is None:
        return None
    with tempfile.NamedTemporaryFile() as fh:
        fh.write(xml_str)
        fh.flush()
        rp = process_nxml(fh.name)
    return rp
Example #4
0
def test_get_xml_invalid():
    pmc_id = '9999999'
    xml_str = pmc_client.get_xml(pmc_id)
    assert(xml_str is None)
Example #5
0
def test_get_xml():
    pmc_id = '4322985'
    xml_str = pmc_client.get_xml(pmc_id)
    assert(xml_str is not None)
Example #6
0
def test_get_xml_invalid():
    pmc_id = '9999999'
    xml_str = pmc_client.get_xml(pmc_id)
    assert (xml_str is None)
Example #7
0
def test_get_xml():
    pmc_id = '4322985'
    xml_str = pmc_client.get_xml(pmc_id)
    assert (xml_str is not None)