def test05(self): """DBSPrimaryDataset.listPrimaryDatasets""" from dbs.business.DBSPrimaryDataset import DBSPrimaryDataset bo = DBSPrimaryDataset(self.logger, self.dbi) bo.listPrimaryDatasets() result = bo.listPrimaryDatasets("ThisDoesNotExist") self.assertEqual(len(result), 0)
def test02(self): """business.DBSPrimaryDataset.listPrimaryDatasets: Basic""" dbowner = os.environ["DBS_TEST_DBOWNER_READER"] dburl = os.environ["DBS_TEST_DBURL_READER"] dbi = DBFactory(self.logger, dburl).connect() bo = DBSPrimaryDataset(self.logger, dbi, dbowner) bo.listPrimaryDatasets() bo.listPrimaryDatasets(primary_ds_name='%') result = bo.listPrimaryDatasets("ThisDoesNotExist") self.assertTrue(type(result) == list) self.assertEqual(len(result), 0)
def test03(self): """business.DBSPrimaryDataset.listPrimaryDatasets: Validation""" dbowner = os.environ["DBS_TEST_DBOWNER_READER"] dburl = os.environ["DBS_TEST_DBURL_READER"] dbi = DBFactory(self.logger, dburl).connect() bo = DBSPrimaryDataset(self.logger, dbi, dbowner) result = bo.listPrimaryDatasets(primary_ds_name=self.primary_ds_name) self.assertTrue(type(result) == list) self.assertEqual(len(result), 1) self.assertEqual(result[0]["primary_ds_name"], self.primary_ds_name)