|
14 | 14 | ) |
15 | 15 | from nwbinspector.testing import load_testing_config |
16 | 16 |
|
17 | | -testing_config = load_testing_config() |
18 | | -testing_file = Path(testing_config["LOCAL_PATH"]) / "image_series_testing_file.nwb" |
| 17 | +try: |
| 18 | + testing_config = load_testing_config() |
| 19 | + testing_file = Path(testing_config["LOCAL_PATH"]) / "image_series_testing_file.nwb" |
| 20 | + NO_CONFIG = False # Depending on the method of installation, a config may not have generated |
| 21 | +except FileNotFoundError: |
| 22 | + testing_file = "Not found" |
| 23 | + NO_CONFIG = True |
19 | 24 |
|
20 | 25 |
|
21 | 26 | @unittest.skipIf( |
22 | | - not testing_file.exists(), |
| 27 | + NO_CONFIG or not testing_file.exists(), |
23 | 28 | reason=f"The ImageSeries unit tests were skipped because the required file ({testing_file}) was not found!", |
24 | 29 | ) |
25 | 30 | class TestExternalFileValid(unittest.TestCase): |
@@ -47,9 +52,7 @@ def test_check_image_series_external_file_valid_bytestring_pass(self): |
47 | 52 | """Can't use the NWB file since the call to io.write() decodes the bytes with modern versions of h5py.""" |
48 | 53 | good_external_path = Path(self.nwbfile.acquisition["TestImageSeriesGoodExternalPaths"].external_file[0]) |
49 | 54 | image_series = ImageSeries( |
50 | | - name="TestImageSeries", |
51 | | - rate=1.0, |
52 | | - external_file=[bytes("/".join([".", good_external_path.name]), "utf-8")], |
| 55 | + name="TestImageSeries", rate=1.0, external_file=[bytes("/".join([".", good_external_path.name]), "utf-8")], |
53 | 56 | ) |
54 | 57 | assert check_image_series_external_file_relative(image_series=image_series) is None |
55 | 58 |
|
|
0 commit comments