def test_retrieve_data_7(self): """Verify that an empty list of CDS data is retrieved for an invalid PhageID.""" result_list = mysqldb.retrieve_data(self.engine, column="PhageID", phage_id_list=["L5"], query=self.gene_query) self.assertEqual(len(result_list), 0)
def test_retrieve_data_3(self): """Verify that dictionaries of data are retrieved for a list of two valid PhageIDs.""" result_list = mysqldb.retrieve_data(self.engine, column="PhageID", phage_id_list=["L5", "Trixie"], query=self.phage_query) self.assertEqual(len(result_list), 2)
def test_retrieve_data_4(self): """Verify that dictionaries of data are retrieved for a list of three valid PhageIDs and one invalid PhageID.""" result_list = mysqldb.retrieve_data( self.engine, column="PhageID", phage_id_list=["L5", "Trixie", "EagleEye", "D29"], query=self.phage_query) self.assertEqual(len(result_list), 3)
def test_retrieve_data_1(self): """Verify that a dictionary of data is retrieved for a valid PhageID.""" result_list = mysqldb.retrieve_data(self.engine, column="PhageID", phage_id_list=["L5"], query=self.phage_query) with self.subTest(): self.assertEqual(len(result_list[0].keys()), 14) with self.subTest(): self.assertEqual(result_list[0]["PhageID"], "L5")
def test_retrieve_data_6(self): """Verify that a list of CDS data is retrieved for a valid PhageID.""" result_list = mysqldb.retrieve_data(self.engine, column="PhageID", phage_id_list=["Trixie"], query=self.gene_query) with self.subTest(): self.assertEqual(len(result_list), 3) with self.subTest(): self.assertEqual(len(result_list[0].keys()), 13) with self.subTest(): self.assertEqual(result_list[0]["PhageID"], "Trixie")
def test_retrieve_data_8(self): """Verify that a list of all CDS data is retrieved when no PhageID is provided.""" result_list = mysqldb.retrieve_data(self.engine, query=self.gene_query) self.assertEqual(len(result_list), 4)
def test_retrieve_data_5(self): """Verify that dictionaries of data are retrieved for multiple valid PhageIDs when no list is provided.""" result_list = mysqldb.retrieve_data(self.engine, query=self.phage_query) self.assertEqual(len(result_list), 3)