def test_sna_cutting(self): """Test basic cutting with SnaI (unknown).""" self.assertEqual(SnaI.elucidate(), '? GTATAC ?') self.assertFalse(SnaI.is_defined()) self.assertFalse(SnaI.is_ambiguous()) self.assertTrue(SnaI.is_unknown()) self.assertFalse(SnaI.is_comm()) self.assertEqual(SnaI.suppliers(), None) self.assertEqual(SnaI.supplier_list(), []) with self.assertRaises(TypeError): SnaI.buffers('no company')
def test_supplier(self): """Test output of supplier list for different enzyme types.""" out = self.StringIO() self.sys.stdout = out EcoRI.suppliers() self.assertIn('Life Technologies', out.getvalue()) self.assertEqual(SnaI.suppliers(), None) EcoRI.all_suppliers() # Independent of enzyme, list of all suppliers self.assertIn('Agilent Technologies', out.getvalue()) batch = EcoRI + SnaI batch.show_codes() self.assertIn('N = New England Biolabs', out.getvalue()) self.sys.stdout = self.sys.__stdout__
def test_supplier(self): """Test output of supplier list for different enzyme types.""" out = self.StringIO() self.sys.stdout = out EcoRI.suppliers() self.assertIn("Thermo Fisher Scientific", out.getvalue()) self.assertIsNone(SnaI.suppliers()) EcoRI.all_suppliers() # Independent of enzyme, list of all suppliers self.assertIn("Agilent Technologies", out.getvalue()) batch = EcoRI + SnaI batch.show_codes() self.assertIn("N = New England Biolabs", out.getvalue()) self.sys.stdout = self.sys.__stdout__
def test_circular_sequences(self): """Deal with cutting circular sequences.""" parts = EcoRI.catalyse(self.ecosite_seq, linear=False) self.assertEqual(len(parts), 1) locations = EcoRI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = KpnI.catalyse(self.kpnsite_seq, linear=False) self.assertEqual(len(parts), 1) locations = KpnI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = SmaI.catalyse(self.smasite_seq, linear=False) self.assertEqual(len(parts), 1) locations = SmaI.search(parts[0], linear=False) self.assertEqual(locations, [1]) self.assertEqual( EarI.search(FormattedSeq(Seq('CTCTTCAAAAA')), linear=False), [8]) self.assertEqual( SnaI.search(FormattedSeq(Seq('GTATACAAAAA')), linear=False), [1])
def test_circular_sequences(self): """Deal with cutting circular sequences.""" parts = EcoRI.catalyse(self.ecosite_seq, linear=False) self.assertEqual(len(parts), 1) locations = EcoRI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = KpnI.catalyse(self.kpnsite_seq, linear=False) self.assertEqual(len(parts), 1) locations = KpnI.search(parts[0], linear=False) self.assertEqual(locations, [1]) parts = SmaI.catalyse(self.smasite_seq, linear=False) self.assertEqual(len(parts), 1) locations = SmaI.search(parts[0], linear=False) self.assertEqual(locations, [1]) self.assertEqual(EarI.search(FormattedSeq(Seq('CTCTTCAAAAA')), linear=False), [8]) self.assertEqual(SnaI.search(FormattedSeq(Seq('GTATACAAAAA')), linear=False), [1])