Exemple #1
0
 def test_validate_ISAtab_example(self):
     from isatools.examples import validateISAtab
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     args = ['validateISAtab.py', os.path.join(utils.TAB_DATA_DIR, 'BII-I-1', 'i_investigation.txt')]
     validateISAtab.main(args)
     sys.stdout = old_stdout
     self.assertIn("Validated 1 ISA-Tab archives, 1 valid ISA-Tab archives, 0 invalid ISA-Tab archives", mystdout.getvalue())
     self.assertIn("Found 0 errors and 40 warnings in across all ISA-Tab archives", mystdout.getvalue())
Exemple #2
0
 def test_validate_ISAtab_example_skip_file(self):
     from isatools.examples import validateISAtab
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     args = ['validateISAtab.py', os.path.join(utils.TAB_DATA_DIR, 'BII-I-1', 'i_investigation.tx')]
     validateISAtab.main(args)
     sys.stdout = old_stdout
     self.assertIn("Validated 0 ISA-Tab archives, 0 valid ISA-Tab archives, 0 invalid ISA-Tab archives",
                   mystdout.getvalue())
Exemple #3
0
 def test_validate_ISAtab_example_invalid(self):
     from isatools.examples import validateISAtab
     with self.assertRaises(SystemExit):
         old_stdout = sys.stdout
         sys.stdout = mystdout = StringIO()
         args = ['validateISAtab.py', os.path.join(utils.TAB_DATA_DIR, 'i_invalid', 'i_01.txt')]
         validateISAtab.main(args)
         sys.stdout = old_stdout
         self.assertIn("Validated 1 ISA-Tab archives, 0 valid ISA-Tab archives, 1 invalid ISA-Tab archives",
                       mystdout.getvalue())
Exemple #4
0
 def test_validate_ISAtab_example_wrong_args(self):
     from isatools.examples import validateISAtab
     with self.assertRaises(SystemExit) as cm:
         validateISAtab.main([])
         self.assertEqual(cm.exception.code, 1)