|
3 | 3 | import hamming |
4 | 4 |
|
5 | 5 |
|
6 | | -# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.1 |
| 6 | +# Tests adapted from `problem-specifications//canonical-data.json` @ v2.2.0 |
7 | 7 |
|
8 | 8 | class HammingTest(unittest.TestCase): |
9 | 9 |
|
10 | 10 | def test_empty_strands(self): |
11 | 11 | self.assertEqual(hamming.distance("", ""), 0) |
12 | 12 |
|
13 | | - def test_identical_strands(self): |
| 13 | + def test_single_letter_identical_strands(self): |
14 | 14 | self.assertEqual(hamming.distance("A", "A"), 0) |
15 | 15 |
|
16 | | - def test_long_identical_strands(self): |
17 | | - self.assertEqual(hamming.distance("GGACTGA", "GGACTGA"), 0) |
18 | | - |
19 | | - def test_complete_distance_in_single_nucleotide_strands(self): |
20 | | - self.assertEqual(hamming.distance("A", "G"), 1) |
21 | | - |
22 | | - def test_complete_distance_in_small_strands(self): |
23 | | - self.assertEqual(hamming.distance("AG", "CT"), 2) |
24 | | - |
25 | | - def test_small_distance_in_small_strands(self): |
26 | | - self.assertEqual(hamming.distance("AT", "CT"), 1) |
27 | | - |
28 | | - def test_small_distance(self): |
29 | | - self.assertEqual(hamming.distance("GGACG", "GGTCG"), 1) |
| 16 | + def test_single_letter_different_strands(self): |
| 17 | + self.assertEqual(hamming.distance("G", "T"), 1) |
30 | 18 |
|
31 | | - def test_small_distance_in_long_strands(self): |
32 | | - self.assertEqual(hamming.distance("ACCAGGG", "ACTATGG"), 2) |
33 | | - |
34 | | - def test_non_unique_character_in_first_strand(self): |
35 | | - self.assertEqual(hamming.distance("AAG", "AAA"), 1) |
36 | | - |
37 | | - def test_non_unique_character_in_second_strand(self): |
38 | | - self.assertEqual(hamming.distance("AAA", "AAG"), 1) |
39 | | - |
40 | | - def test_same_nucleotides_in_different_positions(self): |
41 | | - self.assertEqual(hamming.distance("TAG", "GAT"), 2) |
42 | | - |
43 | | - def test_large_distance(self): |
44 | | - self.assertEqual(hamming.distance("GATACA", "GCATAA"), 4) |
| 19 | + def test_long_identical_strands(self): |
| 20 | + self.assertEqual(hamming.distance("GGACTGAAATCTG", "GGACTGAAATCTG"), 0) |
45 | 21 |
|
46 | | - def test_large_distance_in_off_by_one_strand(self): |
| 22 | + def test_long_different_strands(self): |
47 | 23 | self.assertEqual(hamming.distance("GGACGGATTCTG", "AGGACGGATTCT"), 9) |
48 | 24 |
|
49 | 25 | def test_disallow_first_strand_longer(self): |
|
0 commit comments