Example #1
0
 def test_calculators(self):
     with Print.patch() as p:
         info(True, None, None, None, None, '')
     self.assertGreater(len(str(p)), 10)
Example #2
0
 def test_exports(self):
     with Print.patch() as p:
         info(None, None, None, True, None, '')
     self.assertGreater(len(str(p)), 10)
Example #3
0
 def test_zip(self):
     path = os.path.join(DATADIR, 'frenchbug.zip')
     with Print.patch() as p:
         info(None, None, None, None, None, None, path)
     self.assertEqual(self.EXPECTED, str(p)[:len(self.EXPECTED)])
Example #4
0
 def test_report_ebr(self):
     path = os.path.join(os.path.dirname(case_16.__file__), 'job.ini')
     save = 'openquake.calculators.reportwriter.ReportWriter.save'
     with Print.patch() as p, mock.patch(save, lambda self, fname: None):
         info(None, None, None, None, None, None, True, path)
     self.assertIn('report.rst', str(p))
Example #5
0
 def test_job_ini(self):
     path = os.path.join(os.path.dirname(case_9.__file__), 'job.ini')
     with Print.patch() as p:
         info(None, None, None, None, None, None, None, path)
     # this is a test with multiple same ID sources
     self.assertIn('multiplicity', str(p))
Example #6
0
 def test_job_ini(self):
     path = os.path.join(os.path.dirname(case_9.__file__), 'job.ini')
     with Print.patch() as p:
         info(None, None, None, None, None, None, path)
     # this is a test with multiple same ID sources
     self.assertIn('multiplicity', str(p))
Example #7
0
 def test_extracts(self):
     with Print.patch() as p:
         info(None, None, None, None, True, None, '')
     self.assertGreater(len(str(p)), 10)