def test_cur_grid_shape(self): prj = BaseProject(projects_folder=testing.output_data_folder()) prj.add_to_grid_list(testing.input_test_files(".bag")[0]) prj.set_cur_grid(testing.input_test_files(".bag")[0]) prj.open_to_read_cur_grid() self.assertEquals(prj.cur_grid_shape[0], 0) self.assertEquals(prj.cur_grid_shape[1], 0)
def test_cur_grid_has_layers(self): prj = BaseProject(projects_folder=testing.output_data_folder()) with self.assertRaises(RuntimeError): prj.cur_grid_has_depth_layer() with self.assertRaises(RuntimeError): prj.cur_grid_has_product_uncertainty_layer() with self.assertRaises(RuntimeError): prj.cur_grid_has_density_layer() with self.assertRaises(RuntimeError): prj.cur_grid_has_tvu_qc_layer() with self.assertRaises(RuntimeError): prj.cur_grid_tvu_qc_layers() with self.assertRaises(RuntimeError): prj.set_cur_grid_tvu_qc_name("fake") prj.add_to_grid_list(testing.input_test_files(".bag")[0]) prj.set_cur_grid(testing.input_test_files(".bag")[0]) prj.open_to_read_cur_grid() self.assertTrue(prj.cur_grid_has_depth_layer()) self.assertTrue(prj.cur_grid_has_product_uncertainty_layer()) self.assertFalse(prj.cur_grid_has_density_layer()) self.assertFalse(prj.cur_grid_has_tvu_qc_layer()) self.assertEqual(len(prj.cur_grid_tvu_qc_layers()), 0) self.assertTrue(prj.has_bag_grid()) self.assertFalse(prj.has_csar_grid())
def test_select_layers_in_cur_grid(self): prj = BaseProject(projects_folder=testing.output_data_folder()) prj.add_to_grid_list(testing.input_test_files(".bag")[0]) prj.set_cur_grid(testing.input_test_files(".bag")[0]) prj.open_to_read_cur_grid() self.assertEqual(len(prj.selected_layers_in_cur_grid), 0) prj.selected_layers_in_cur_grid = [layer_types['depth'], ] self.assertEqual(len(prj.selected_layers_in_cur_grid), 1)
def test_grid_read(self): prj = BaseProject(projects_folder=testing.output_data_folder()) self.assertTrue(prj.cur_grid is None) self.assertFalse(prj.has_grid()) with self.assertRaises(RuntimeError): _ = prj.cur_grid_basename prj.add_to_grid_list(testing.input_test_files(".bag")[0]) prj.set_cur_grid(testing.input_test_files(".bag")[0]) prj.open_to_read_cur_grid() self.assertTrue(prj.cur_grid is not None) self.assertTrue(prj.has_grid()) self.assertGreater(len(prj.cur_grid_basename), 0)