def test_modify_import_data_2(self): """Verify returns False if there are extra keys.""" self.ticket_dict3["extra"] = "extra" result = tickets.modify_import_data(self.ticket_dict3, self.required_keys, self.optional_keys, self.keywords) self.assertFalse(result)
def test_modify_import_data_5(self): """Verify returns True with completed dictionary from a minimal replace ticket.""" self.ticket_dict4["type"] = "replace" self.ticket_dict4["description_field"] = "product" self.ticket_dict4["eval_mode"] = "final" result = tickets.modify_import_data(self.ticket_dict4, self.required_keys, self.optional_keys, self.keywords) with self.subTest(): self.assertTrue(result) with self.subTest(): self.assertEqual(self.ticket_dict4["host_genus"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict4["cluster"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict4["subcluster"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict4["annotation_author"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict4["retrieve_record"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict4["annotation_status"], "final") with self.subTest(): self.assertEqual(self.ticket_dict4["accession"], "retain")
def test_modify_import_data_3(self): """Verify returns True with keywords identified and values lowercased.""" result = tickets.modify_import_data(self.ticket_dict3, self.required_keys, self.optional_keys, self.keywords) with self.subTest(): self.assertTrue(result) with self.subTest(): self.assertEqual(self.ticket_dict3["host_genus"], "retrieve") with self.subTest(): self.assertEqual(self.ticket_dict3["retrieve_record"], "retain") with self.subTest(): self.assertEqual(self.ticket_dict3["subcluster"], "retrieve") with self.subTest(): self.assertEqual(self.ticket_dict3["accession"], "parse") with self.subTest(): self.assertEqual(self.ticket_dict3["type"], "add") with self.subTest(): self.assertEqual(self.ticket_dict3["description_field"], "product") with self.subTest(): self.assertEqual(self.ticket_dict3["eval_mode"], "final")
def test_modify_import_data_1(self): """Verify returns False if there are missing required keys.""" result = tickets.modify_import_data(self.ticket_dict2, self.required_keys, self.optional_keys, self.keywords) self.assertFalse(result)