def test_data_transfer(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(path, datatransfer=True) got = str(p) self.assertIn('RlzsAssoc', got) self.assertIn('Number of tasks to be generated: 14', got)
def test_zip_filtering(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(path, filtersources=True) exp = self.EXPECTED + ''' n_sites 1 n_sources 1 n_levels 29 output_weight 29.0 n_realizations 1 n_imts 1 curve_matrix_size 232 B''' self.assertEqual(exp, str(p))
def test_zip_filtering(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(path, filtersources=True) exp = self.EXPECTED + ''' c_matrix 232 B max_realizations 1 n_imts 1 n_levels 29.0 n_sites 1 n_sources 1 output_weight 29.0''' self.assertEqual(exp, str(p))
def test_zip_weighting(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(path, weightsources=True) exp = self.EXPECTED + ''' n_sites 1 n_sources 1 input_weight 1722.0 n_levels 29 output_weight 29.0 n_realizations 1 n_imts 1 curve_matrix_size 232 B''' self.assertEqual(exp, str(p))
def test_zip(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(path) self.assertEqual(self.EXPECTED, str(p))
def test_exports(self): with Print.patch() as p: info(None, None, None, True, None, '') self.assertGreater(len(str(p)), 10)
def test_calculators(self): with Print.patch() as p: info(True, None, None, None, None, '') self.assertGreater(len(str(p)), 10)
def test_zip(self): path = os.path.join(DATADIR, 'frenchbug.zip') with Print.patch() as p: info(None, None, None, None, None, path) self.assertEqual(self.EXPECTED, str(p)[:len(self.EXPECTED)])