Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
josix committed Oct 26, 2017
2 parents 1439c97 + bbf0b73 commit 1810b31
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions exercises/clock/clock_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from clock import Clock

# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.1


class ClockTest(unittest.TestCase):
# Test creating a new clock with an initial time.
Expand Down
12 changes: 6 additions & 6 deletions exercises/hamming/hamming_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import hamming


# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.1

class HammingTest(unittest.TestCase):

def test_empty_strands(self):
self.assertEqual(hamming.distance("", ""), 0)

def test_identical_strands(self):
self.assertEqual(hamming.distance("A", "A"), 0)

Expand All @@ -29,10 +32,10 @@ def test_small_distance_in_long_strands(self):
self.assertEqual(hamming.distance("ACCAGGG", "ACTATGG"), 2)

def test_non_unique_character_in_first_strand(self):
self.assertEqual(hamming.distance("AGA", "AGG"), 1)
self.assertEqual(hamming.distance("AAG", "AAA"), 1)

def test_non_unique_character_in_second_strand(self):
self.assertEqual(hamming.distance("AGG", "AGA"), 1)
self.assertEqual(hamming.distance("AAA", "AAG"), 1)

def test_same_nucleotides_in_different_positions(self):
self.assertEqual(hamming.distance("TAG", "GAT"), 2)
Expand All @@ -43,9 +46,6 @@ def test_large_distance(self):
def test_large_distance_in_off_by_one_strand(self):
self.assertEqual(hamming.distance("GGACGGATTCTG", "AGGACGGATTCT"), 9)

def test_empty_strands(self):
self.assertEqual(hamming.distance("", ""), 0)

def test_disallow_first_strand_longer(self):
with self.assertRaises(ValueError):
hamming.distance("AATG", "AAA")
Expand Down
2 changes: 2 additions & 0 deletions exercises/two-bucket/two_bucket_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from two_bucket import two_bucket


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0

class TwoBucketTest(unittest.TestCase):
def test_bucket_one_size_3_bucket_two_size_5_start_with_bucket_one(self):
self.assertEqual(two_bucket(3, 5, 1, "one"), (4, "one", 5))
Expand Down

0 comments on commit 1810b31

Please sign in to comment.