Class RawHDF5Dataset
(tmpdir)
| 144 | |
| 145 | |
| 146 | def test_RawHDF5Dataset(tmpdir): |
| 147 | """Class RawHDF5Dataset""" |
| 148 | dir_list, fln, dset = ("dir1", "dir2"), "tmp.txt", "/some/dataset" |
| 149 | file_dir = os.path.join(tmpdir, *dir_list) |
| 150 | os.makedirs(file_dir, exist_ok=True) |
| 151 | os.chdir(file_dir) |
| 152 | # Create file |
| 153 | with open(fln, "w"): |
| 154 | pass |
| 155 | |
| 156 | # 'fln' should be converted to absolute |
| 157 | # 'shape' is set to some arbitrary valid tuple |
| 158 | rds = RawHDF5Dataset(fln, dset, shape=(10, 50)) |
| 159 | |
| 160 | assert os.path.isabs(rds.abs_path), "Path was not successfully converted to absolute path" |
| 161 | # If file exists, then the file name was correctly set |
| 162 | assert os.path.exists(rds.abs_path), "Path was not correctly set" |
| 163 | assert rds.dset_name == dset, "Dataset name was not currectly set" |
| 164 | assert rds.shape == (10, 50), "Attribute 'shape' was not set correctly" |
| 165 | |
| 166 | |
| 167 | # fmt: off |
nothing calls this directly
no test coverage detected