예제 #1
0
 def test_empty_strands(self):
     self.assertEqual(hamming.distance("", ""), 0)
예제 #2
0
 def test_single_letter_identical_strands(self):
     self.assertEqual(hamming.distance("A", "A"), 0)
예제 #3
0
 def test_disallow_second_strand_longer(self):
     with self.assertRaisesWithMessage(ValueError):
         hamming.distance("ATA", "AGTG")
예제 #4
0
 def test_disallow_right_empty_strand(self):
     with self.assertRaisesWithMessage(ValueError):
         hamming.distance("G", "")
예제 #5
0
 def test_long_different_strands(self):
     self.assertEqual(hamming.distance("GGACGGATTCTG", "AGGACGGATTCT"), 9)
예제 #6
0
 def test_disallow_first_strand_longer(self):
     with self.assertRaisesWithMessage(ValueError):
         hamming.distance("AATG", "AAA")
예제 #7
0
 def test_single_letter_different_strands(self):
     self.assertEqual(hamming.distance("G", "T"), 1)
예제 #8
0
 def test_long_identical_strands(self):
     self.assertEqual(hamming.distance("GGACTGAAATCTG", "GGACTGAAATCTG"), 0)
예제 #9
0
 def test_hamming_distance_in_very_long_strand(self):
     self.assertEqual(9, distance('GGACGGATTCTG', 'AGGACGGATTCT'))
예제 #10
0
 def test_no_difference_between_identical_strands(self):
     self.assertEqual(0, distance('A', 'A'))
예제 #11
0
 def test_large_hamming_distance(self):
     self.assertEqual(4, distance('GATACA', 'GCATAA'))
예제 #12
0
 def test_small_hamming_distance_in_longer_strand(self):
     self.assertEqual(1, distance('GGACG', 'GGTCG'))
예제 #13
0
 def test_small_hamming_distance(self):
     self.assertEqual(1, distance('AT', 'CT'))
예제 #14
0
 def test_complete_hamming_distance_of_for_small_strand(self):
     self.assertEqual(2, distance('AG', 'CT'))
예제 #15
0
 def test_complete_hamming_distance_of_for_single_nucleotide_strand(self):
     self.assertEqual(1, distance('A', 'G'))