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()
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()
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()
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()
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