Пример #1
0
 def test_basic_isochizomers(self):
     """Test to be sure isochizomer and neoschizomers are as expected."""
     self.assertEqual(Acc65I.isoschizomers(), [Asp718I, KpnI])
     self.assertEqual(Acc65I.elucidate(), 'G^GTAC_C')
     self.assertEqual(Asp718I.elucidate(), 'G^GTAC_C')
     self.assertEqual(KpnI.elucidate(), 'G_GTAC^C')
     self.assertTrue(Acc65I.is_isoschizomer(KpnI))
     self.assertFalse(Acc65I.is_equischizomer(KpnI))
     self.assertTrue(Acc65I.is_neoschizomer(KpnI))
     self.assertIn(Acc65I, Asp718I.equischizomers())
     self.assertIn(KpnI, Asp718I.neoschizomers())
     self.assertIn(KpnI, Acc65I.isoschizomers())
Пример #2
0
 def test_basic_isochizomers(self):
     """Test to be sure isochizomer and neoschizomers are as expected."""
     self.assertEqual(Acc65I.isoschizomers(), [Asp718I, KpnI])
     self.assertEqual(Acc65I.elucidate(), 'G^GTAC_C')
     self.assertEqual(Asp718I.elucidate(), 'G^GTAC_C')
     self.assertEqual(KpnI.elucidate(), 'G_GTAC^C')
     self.assertTrue(Acc65I.is_isoschizomer(KpnI))
     self.assertFalse(Acc65I.is_equischizomer(KpnI))
     self.assertTrue(Acc65I.is_neoschizomer(KpnI))
     self.assertIn(Acc65I, Asp718I.equischizomers())
     self.assertIn(KpnI, Asp718I.neoschizomers())
     self.assertIn(KpnI, Acc65I.isoschizomers())
Пример #3
0
 def test_basic_isochizomers(self):
     """Test to be sure isochizomer and neoschizomers are as expected.
     """
     self.assertEqual(Acc65I.isoschizomers(), [Asp718I, KpnI])
     self.assertEqual(Acc65I.elucidate(), 'G^GTAC_C')
     self.assertEqual(Asp718I.elucidate(), 'G^GTAC_C')
     self.assertEqual(KpnI.elucidate(), 'G_GTAC^C')
Пример #4
0
    def test_comparisons(self):
        """Test comparison operators between different enzymes."""
        # Comparison of iso- and neoschizomers
        self.assertEqual(Acc65I, Acc65I)
        self.assertNotEqual(Acc65I, KpnI)
        self.assertFalse(Acc65I == Asp718I)
        # self.assertNotEqual(Acc65I, Asp718I) it doesn't work as expected
        self.assertFalse(Acc65I != Asp718I)
        self.assertNotEqual(Acc65I, EcoRI)
        self.assertTrue(Acc65I >> KpnI)
        self.assertFalse(Acc65I >> Asp718I)

        # Compare length of recognition sites
        self.assertFalse(EcoRI >= EcoRV)
        self.assertTrue(EcoRV >= EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV >= 3
        self.assertFalse(EcoRI > EcoRV)
        self.assertTrue(EcoRV > EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV > 3
        self.assertTrue(EcoRI <= EcoRV)
        self.assertFalse(EcoRV <= EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV <= 3
        self.assertTrue(EcoRI < EcoRV)
        self.assertFalse(EcoRV < EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV < 3

        # Compare compatible overhangs
        self.assertTrue(Acc65I % Asp718I)
        self.assertTrue(Acc65I % Acc65I)
        self.assertFalse(Acc65I % KpnI)
        with self.assertRaises(TypeError):
            Acc65I % "KpnI"
        self.assertTrue(SmaI % EcoRV)
        self.assertTrue(EarI % EarI)
        self.assertIn(EcoRV, SmaI.compatible_end())
        self.assertIn(Acc65I, Asp718I.compatible_end())
Пример #5
0
    def test_comparisons(self):
        """Test comparison operators between different enzymes."""
        # Comparison of iso- and neoschizomers
        self.assertEqual(Acc65I, Acc65I)
        self.assertNotEqual(Acc65I, KpnI)
        self.assertFalse(Acc65I == Asp718I)
        self.assertFalse(Acc65I != Asp718I)
        self.assertNotEqual(Acc65I, EcoRI)
        self.assertTrue(Acc65I >> KpnI)
        self.assertFalse(Acc65I >> Asp718I)

        # Compare length of recognition sites
        self.assertFalse(EcoRI >= EcoRV)
        self.assertTrue(EcoRV >= EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV >= 3
        self.assertFalse(EcoRI > EcoRV)
        self.assertTrue(EcoRV > EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV > 3
        self.assertTrue(EcoRI <= EcoRV)
        self.assertFalse(EcoRV <= EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV <= 3
        self.assertTrue(EcoRI < EcoRV)
        self.assertFalse(EcoRV < EcoRI)
        with self.assertRaises(NotImplementedError):
            EcoRV < 3

        # Compare compatible overhangs
        self.assertTrue(Acc65I % Asp718I)
        self.assertTrue(Acc65I % Acc65I)
        self.assertFalse(Acc65I % KpnI)
        with self.assertRaises(TypeError):
            Acc65I % 'KpnI'
        self.assertTrue(SmaI % EcoRV)
        self.assertTrue(EarI % EarI)
        self.assertIn(EcoRV, SmaI.compatible_end())
        self.assertIn(Acc65I, Asp718I.compatible_end())