def test_identify_duplicates_2(self): """Verify two tickets with 'none' duplicates do not generate an error.""" ticket1 = ticket.ImportTicket() ticket1.id = "none" ticket1.type = "replace" ticket1.phage_id = "none" ticket2 = ticket.ImportTicket() ticket2.id = "none" ticket2.type = "replace" ticket2.phage_id = "none" null_set = set(["none"]) list_of_tickets = [ticket1, ticket2] id_dupes, phage_id_dupes = \ tickets.identify_duplicates(list_of_tickets, null_set=null_set) with self.subTest(): self.assertEqual(len(id_dupes), 0) with self.subTest(): self.assertEqual(len(phage_id_dupes), 0)
def test_identify_duplicates_6(self): """Verify two tickets with multiple duplicates do generate multiple errors.""" ticket1 = ticket.ImportTicket() ticket1.id = 1 ticket1.type = "replace" ticket1.phage_id = "Trixie" ticket2 = ticket.ImportTicket() ticket2.id = 1 ticket2.type = "replace" ticket2.phage_id = "Trixie" null_set = set(["none"]) list_of_tickets = [ticket1, ticket2] id_dupes, phage_id_dupes = \ tickets.identify_duplicates(list_of_tickets, null_set=null_set) with self.subTest(): self.assertEqual(len(id_dupes), 1) with self.subTest(): self.assertEqual(len(phage_id_dupes), 1)
def test_identify_duplicates_1(self): """Verify no duplicates are produced.""" ticket1 = ticket.ImportTicket() ticket1.id = 1 ticket1.type = "replace" ticket1.phage_id = "Trixie" ticket2 = ticket.ImportTicket() ticket2.id = 2 ticket2.type = "replace" ticket2.phage_id = "L5" null_set = set(["none"]) list_of_tickets = [ticket1, ticket2] id_dupes, phage_id_dupes = \ tickets.identify_duplicates(list_of_tickets, null_set=null_set) with self.subTest(): self.assertEqual(len(id_dupes), 0) with self.subTest(): self.assertEqual(len(phage_id_dupes), 0)