def test_get_next_combos(self): tester = ShotgunPrimerSet(1) self.assertEqual(tester.current_combo_index, 384) with self.assertRaises(ValueError): tester.get_next_combos(0) with self.assertRaises(ValueError): tester.get_next_combos(150000) obs = tester.get_next_combos(5) self.assertEqual(tester.current_combo_index, 389) self.assertEqual(len(obs), 5) exp = [(PrimerSetComposition(769), PrimerSetComposition(1155)), (PrimerSetComposition(771), PrimerSetComposition(1157)), (PrimerSetComposition(773), PrimerSetComposition(1159)), (PrimerSetComposition(775), PrimerSetComposition(1161)), (PrimerSetComposition(777), PrimerSetComposition(1163))] self.assertEqual(obs, exp)
def test_get_next_combos(self): tester = ShotgunPrimerSet(1) # NOTE: 380 instead of 384 because the test sample plate contains 1 # empty well. When the plate is collapsed 4 times into a 384-well plate # this results with 4 empty wells not included in library prep self.assertEqual(tester.current_combo_index, 380) with self.assertRaises(ValueError): tester.get_next_combos(0) with self.assertRaises(ValueError): tester.get_next_combos(150000) obs = tester.get_next_combos(5) self.assertEqual(tester.current_combo_index, 385) self.assertEqual(len(obs), 5) exp = [(PrimerSetComposition(1146), PrimerSetComposition(1530)), (PrimerSetComposition(1148), PrimerSetComposition(1532)), (PrimerSetComposition(1150), PrimerSetComposition(1534)), (PrimerSetComposition(1152), PrimerSetComposition(1536)), (PrimerSetComposition(769), PrimerSetComposition(1155))] self.assertEqual(obs, exp)
def test_attributes(self): tester = ShotgunPrimerSet(1) self.assertEqual(tester.external_id, 'iTru combos December 2017')