Beispiel #1
0
 def test_validate_ISAjson_example_skip_file(self):
     from isatools.examples import validateISAjson
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     args = ['validateISAjson.py', os.path.join(utils.JSON_DATA_DIR, 'BII-I-1', 'BII-I-1.jso')]
     validateISAjson.main(args)
     sys.stdout = old_stdout
     self.assertIn("Validated 0 ISA-JSONs, 0 valid ISA-JSONs, 0 invalid ISA-JSONs", mystdout.getvalue())
Beispiel #2
0
 def test_validate_ISAjson_example(self):
     from isatools.examples import validateISAjson
     old_stdout = sys.stdout
     sys.stdout = mystdout = StringIO()
     args = ['validateISAjson.py', os.path.join(utils.JSON_DATA_DIR, 'BII-I-1', 'BII-I-1.json')]
     validateISAjson.main(args)
     sys.stdout = old_stdout
     self.assertIn("Validated 1 ISA-JSONs, 1 valid ISA-JSONs, 0 invalid ISA-JSONs", mystdout.getvalue())
     self.assertIn("Found 0 errors and 136 warnings in across all ISA-JSONs", mystdout.getvalue())  # TODO: Double check why the warnings occur
Beispiel #3
0
 def test_validate_ISAjson_example_invalid(self):
     from isatools.examples import validateISAjson
     with self.assertRaises(SystemExit):
         old_stdout = sys.stdout
         sys.stdout = mystdout = StringIO()
         args = ['validateISAjson.py', os.path.join(utils.JSON_DATA_DIR, 'unit', 'invalid_isajson.json')]
         validateISAjson.main(args)
         sys.stdout = old_stdout
         self.assertIn("Validated 1 ISA-JSONs, 0 valid ISA-JSONs, 1 invalid ISA-JSONs", mystdout.getvalue())
Beispiel #4
0
 def test_validate_ISAjson_example_wrong_args(self):
     from isatools.examples import validateISAjson
     with self.assertRaises(SystemExit) as cm:
         validateISAjson.main([])
         self.assertEqual(cm.exception.code, 1)