Ejemplo n.º 1
0
def test_zenodo_download():
    with tempdir.TempDir() as t:
        library.library = [t]
        local_name = library.find_in_library("doi:10.5281/zenodo.7648")
        assert local_name == os.path.join(t, "10.5281/zenodo.7648.ap")
        paper = ActivePaper(local_name)
        assert ascii(paper.code_group["python-packages/mosaic/__init__"].attrs["ACTIVE_PAPER_DATATYPE"]) == "module"
        paper.close()
Ejemplo n.º 2
0
def test_figshare_download():
    with tempdir.TempDir() as t:
        library.library = [t]
        local_name = library.find_in_library("doi:10.6084/m9.figshare.692144")
        assert local_name == os.path.join(t, "10.6084/m9.figshare.692144.ap")
        paper = ActivePaper(local_name)
        assert ascii(paper.code_group["python-packages/immutable/__init__"].attrs["ACTIVE_PAPER_DATATYPE"]) == "module"
        paper.close()
Ejemplo n.º 3
0
def test_zenodo_download():
    with tempdir.TempDir() as t:
        library.library = [t]
        local_name = library.find_in_library("doi:10.5281/zenodo.7648")
        assert local_name == os.path.join(t, "10.5281/zenodo.7648.ap")
        paper = ActivePaper(local_name)
        assert ascii(paper.code_group['python-packages/mosaic/__init__'].
                     attrs['ACTIVE_PAPER_DATATYPE']) == 'module'
        paper.close()
Ejemplo n.º 4
0
def test_figshare_download():
    with tempdir.TempDir() as t:
        library.library = [t]
        local_name = library.find_in_library("doi:10.6084/m9.figshare.692144")
        assert local_name == os.path.join(t, "10.6084/m9.figshare.692144.ap")
        paper = ActivePaper(local_name)
        assert ascii(paper.code_group['python-packages/immutable/__init__'].
                     attrs['ACTIVE_PAPER_DATATYPE']) == 'module'
        paper.close()
Ejemplo n.º 5
0
def open_paper_ref(paper_ref):
    if paper_ref in _papers:
        return _papers[paper_ref]
    paper = ActivePaper(find_in_library(paper_ref), "r")
    _papers[paper_ref] = paper
    return paper
Ejemplo n.º 6
0
def open_paper_ref(paper_ref):
    if paper_ref in _papers:
        return _papers[paper_ref]
    paper = ActivePaper(find_in_library(paper_ref), "r")
    _papers[paper_ref] = paper
    return paper