예제 #1
0
def test_load_md_good():
    # This uses an actual file for testing
    md_path = Path('./jax_omeroutils/tests/data/OMERO_submission_form.xlsx')
    md = intake.load_md_from_file(md_path, sheet_name="Example Form")
    assert md['omero_user'] == 'djme'
    assert md['omero_group'] == 'Research IT'
    assert md['file_metadata'][0]['filename'] == 'my_image.tif'
def test_load_md_good(tmp_path):
    md_path = _tmp_builder(tmp_path, 5) / 'md.tsv'
    md = intake.load_md_from_file(md_path)
    assert md.filename[0] == 'image0.tif'
    assert md.project[0] == 'testproject'
    assert md.genotype[1] == 'C57Bl6'
def test_load_md_fp_isNone():
    assert intake.load_md_from_file(None) is None
def test_load_md_invalid_ftypes():
    with pytest.raises(ValueError):
        intake.load_md_from_file('/path/to/junk.xls.5')
예제 #5
0
def test_load_md_nofile(tmp_path):
    with pytest.raises(FileNotFoundError):
        intake.load_md_from_file(tmp_path / 'md.xlsx')
예제 #6
0
def test_load_md_invalid_ftypes(tmp_path):
    open(tmp_path / 'md2.xls.5', 'a').close()
    with pytest.raises(ValueError):
        intake.load_md_from_file(tmp_path / 'md2.xls.5')