def test_get_path(self): """Test retrieving a file path.""" s = DataStore() result = s.get_path(self.fname) assert isinstance(result, str) assert os.fspath(self.data_path / self.fname) == result with pytest.raises(ValueError, match=r"No file found named"): s.get_path("693_UNCI")
def test_get_path_raises_bad_dtype(self): """Test get_path raises if unsupported dtype.""" s = DataStore() msg = r"No files available for the data type" with pytest.raises(ValueError, match=msg): s.get_path(self.fname, dtype=1)
def test_get_path_raises_bad_fname(self): """Test get_path raises if no matching filename.""" s = DataStore() msg = r"No file found named 'no matching name.txt'" with pytest.raises(ValueError, match=msg): s.get_path("no matching name.txt")