diff --git a/illumina.py b/illumina.py index 8041dcbea..ff1bf5242 100755 --- a/illumina.py +++ b/illumina.py @@ -596,13 +596,17 @@ def close(self): self.tempDir = None def get_RunInfo(self): - if self.runinfo is None and os.path.isfile(os.path.join(self.path, 'RunInfo.xml')): - self.runinfo = RunInfo(os.path.join(self.path, 'RunInfo.xml')) + if self.runinfo is None: + runinfo_file = os.path.join(self.path, 'RunInfo.xml') + util.file.check_paths(runinfo_file) + self.runinfo = RunInfo(runinfo_file) return self.runinfo def get_SampleSheet(self, only_lane=None): - if self.samplesheet is None and os.path.isfile(os.path.join(self.path, 'SampleSheet.csv')): - self.samplesheet = SampleSheet(os.path.join(self.path, 'SampleSheet.csv'), only_lane=only_lane) + if self.samplesheet is None: + samplesheet_file = os.path.join(self.path, 'SampleSheet.csv') + util.file.check_paths(samplesheet_file) + self.samplesheet = SampleSheet(samplesheet_file, only_lane=only_lane) return self.samplesheet def get_intensities_dir(self): diff --git a/test/unit/test_illumina.py b/test/unit/test_illumina.py index e75be54ca..30e08753c 100644 --- a/test/unit/test_illumina.py +++ b/test/unit/test_illumina.py @@ -192,9 +192,9 @@ def test_tarball_run_info(self): def test_tarball_fail_missing_data(self): inDir = util.file.get_test_input_path(self) with illumina.IlluminaDirectory(os.path.join(inDir, 'bcl-runinfo.tar.gz')) as idir: - self.assertRaises(Exception, idir.get_SampleSheet()) + self.assertRaises(Exception, idir.get_SampleSheet) with illumina.IlluminaDirectory(os.path.join(inDir, 'bcl-samplesheet.tar.gz')) as idir: - self.assertRaises(Exception, idir.get_RunInfo()) + self.assertRaises(Exception, idir.get_RunInfo) class TestDifficultSampleNames(TestCaseWithTmp):