예제 #1
0
 def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_two(
         self):
     self.assertEqual(measure(7, 11, 2, "two"), (18, "two", 7))
예제 #2
0
 def test_bucket_one_size_2_bucket_two_size_3_start_with_bucket_one(self):
     self.assertEqual(measure(2, 3, 3, "one"), (2, "two", 2))
예제 #3
0
 def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_two(
         self):
     self.assertEqual(measure(3, 5, 1, "two"), (8, "two", 3))
예제 #4
0
 def test_bucket_one_size_3_bucket_two_size_5_start_with_bucket_two(self):
     self.assertEqual(measure(3, 5, 1, "two"), (8, "two", 3))
예제 #5
0
 def test_bucket_one_size_7_bucket_two_size_11_start_with_bucket_two(self):
     self.assertEqual(measure(7, 11, 2, "two"), (18, "two", 7))
예제 #6
0
 def test_7_11(
         self,
 ):
     self.assertEqual(measure(7, 11, 6, "one"), (10, "one", 11))
예제 #7
0
 def test_with_the_same_buckets_but_a_different_goal_then_it_is_possible(self):
     self.assertEqual(measure(6, 15, 9, "one"), (10, "two", 0))
예제 #8
0
 def test_measure_using_b1_of_size_6_and_b2_of_size_15_start_with_b1_1_2_9(
         self):
     self.assertEqual(measure(6, 15, 9, "one"), (10, "two", 0))
     self.assertEqual(measure(6, 15, 9, "two"), (2, "two", 6))
예제 #9
0
 def test_measure_using_b1_of_size_6_and_b2_of_size_15_start_with_b1_1_2_18(
         self):
     self.assertEqual(measure(6, 15, 18, "one"), (6, 'two', 3))
     self.assertEqual(measure(6, 15, 18, "two"), (8, 'two', 6))
예제 #10
0
 def test_measure1_step_using_b1_of_size_1_and_b2_of_size_3_start_with_b2(
         self):
     self.assertEqual(measure(1, 3, 3, "two"), (1, "two", 0))
예제 #11
0
 def test_measure_using_b1_of_size_6_and_b2_of_size_15_start_with_b1_4_impossible(
         self):
     with self.assertRaisesWithMessage(ValueError):
         self.assertEqual(measure(6, 15, 4, "one"))
예제 #12
0
 def test_measure_using_b1_of_size_7_and_b2_of_size_11_start_with_b2(self):
     self.assertEqual(measure(7, 11, 2, "two"), (18, "two", 7))
예제 #13
0
 def test_measure_using_b1_of_size_7_and_b2_of_size_11_start_with_b1(self):
     self.assertEqual(measure(7, 11, 2, "one"), (14, "one", 11))
예제 #14
0
 def test_measure_using_b1_of_size_5_and_b2_of_size_3_start_with_b2_4(self):
     # make 4L
     self.assertEqual(measure(5, 3, 4, "two"), (8, "one", 0))
예제 #15
0
 def test_measure_using_bucket_one_of_size_2_and_bucket_two_of_size_3_start_with_bucket_one_and_end_with_bucket_two(
         self):
     self.assertEqual(measure(2, 3, 3, "one"), (2, "two", 2))
예제 #16
0
 def test_measure_using_b1_of_size_2_and_b2_of_size_15_start_with_b1_1_2_1(
         self):
     self.assertEqual(measure(2, 15, 1, "one"), (16, 'one', 15))
     self.assertEqual(measure(2, 15, 1, "two"), (14, 'two', 2))
예제 #17
0
 def test_measure_using_b1_of_size_3_and_b2_of_size_5_start_with_b2_1(self):
     self.assertEqual(measure(3, 5, 1, "two"), (8, "two", 3))
예제 #18
0
 def test_measure_using_b1_of_size_2_and_b2_of_size_15_start_with_b1_1_2_17(
         self):
     self.assertEqual(measure(2, 15, 17, "one"), (2, 'both', 17))
     self.assertEqual(measure(2, 15, 17, "two"), (2, 'both', 17))
예제 #19
0
 def test_not_possible_to_reach_the_goal(self):
     with self.assertRaisesWithMessage(ValueError):
         measure(6, 15, 5, "one")
예제 #20
0
 def test_measure_using_b1_of_size_3_and_b2_of_size_5_start_with_b1_1(self):
     self.assertEqual(measure(3, 5, 1, "one"), (4, "one", 5))
예제 #21
0
 def test_goal_larger_than_both_buckets_is_impossible(self):
     with self.assertRaisesWithMessage(ValueError):
         measure(5, 7, 8, "one")
 def test_bucket_one_size_3_bucket_two_size_5_start_with_bucket_two(self):
     self.assertEqual(measure(3, 5, 1, "two"), (8, "two", 3))
예제 #23
0
 def test_bucket_one_size_7_bucket_two_size_11_start_with_bucket_one(self):
     self.assertEqual(measure(7, 11, 2, "one"), (14, "one", 11))
 def test_bucket_one_size_7_bucket_two_size_11_start_with_bucket_one(self):
     self.assertEqual(measure(7, 11, 2, "one"), (14, "one", 11))
예제 #25
0
 def test_bucket_one_size_1_bucket_two_size_3_start_with_bucket_two(self):
     self.assertEqual(measure(1, 3, 3, "two"), (1, "two", 0))
 def test_bucket_one_size_7_bucket_two_size_11_start_with_bucket_two(self):
     self.assertEqual(measure(7, 11, 2, "two"), (18, "two", 7))
예제 #27
0
 def test_bucket_one_size_3_bucket_two_size_5_start_with_bucket_one(self):
     self.assertEqual(measure(3, 5, 1, "one"), (4, "one", 5))
 def test_bucket_one_size_1_bucket_two_size_3_start_with_bucket_two(self):
     self.assertEqual(measure(1, 3, 3, "two"), (1, "two", 0))
예제 #29
0
 def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_one(
         self):
     self.assertEqual(measure(7, 11, 2, "one"), (14, "one", 11))
 def test_bucket_one_size_2_bucket_two_size_3_start_with_bucket_one(self):
     self.assertEqual(measure(2, 3, 3, "one"), (2, "two", 2))
예제 #31
0
 def test_measure_one_step_using_bucket_one_of_size_1_and_bucket_two_of_size_3_start_with_bucket_two(
         self):
     self.assertEqual(measure(1, 3, 3, "two"), (1, "two", 0))
 def test_bucket_one_size_3_bucket_two_size_5_start_with_bucket_one(self):
     self.assertEqual(measure(3, 5, 1, "one"), (4, "one", 5))
예제 #33
0
 def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_one(
         self):
     self.assertEqual(measure(3, 5, 1, "one"), (4, "one", 5))
예제 #34
0
 def test_measure_using_b1_of_size_5_and_b2_of_size_3_start_with_b1_2_7(
         self):
     # make 7L
     self.assertEqual(measure(5, 3, 7, "one"), (6, "two", 4))
     self.assertEqual(measure(5, 3, 7, "two"), (10, "two", 5))