Пример #1
0
 def test_two_different_books(self):
     self.assertEqual(calculate_total([1, 2]), 1520)
Пример #2
0
 def test_four_different_books(self):
     self.assertEqual(calculate_total([1, 2, 3, 4]), 2560)
Пример #3
0
 def test_four_groups_of_4_are_cheaper_than_2_groups_each_of_5_and_3(self):
     self.assertEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5]),
         10240)
Пример #4
0
 def test_two_of_the_same_book(self):
     self.assertEqual(calculate_total([2, 2]), 1600)
Пример #5
0
 def test_six_different_books(self):
     self.assertEqual(calculate_total([1, 2, 3, 4, 5, 6]), 3600)
Пример #6
0
 def test_three_copies_of_first_book_and_2_each_of_remaining(self):
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1]),
                      6800)
Пример #7
0
 def test_five_different_books(self):
     self.assertAlmostEqual(
         calculate_total([1, 2, 3, 4, 5]), 30.00,
         places=2)
Пример #8
0
 def test_three_copies_of_first_book_and_2_each_of_remaining(self):
     self.assertEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1]), 6800)
Пример #9
0
 def test_three_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2, 3]), 21.60,
                            places=2)
Пример #10
0
 def test_four_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2, 3, 4]), 25.60,
                            places=2)
Пример #11
0
 def test_two_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2]), 15.20,
                            places=2)
Пример #12
0
 def test_empty_basket(self):
     self.assertAlmostEqual(calculate_total([]), 0.00,
                            places=2)
Пример #13
0
 def test_two_of_the_same_book(self):
     self.assertAlmostEqual(calculate_total([2, 2]), 16.00,
                            places=2)
Пример #14
0
 def test_two_groups_of_4_is_cheaper_than_groups_of_5_and_3(self):
     self.assertEqual(calculate_total([1, 1, 2, 3, 4, 4, 5, 5]), 5120)
Пример #15
0
 def test_two_groups_of_4_is_cheaper_than_group_of_5_plus_group_of_3(self):
     self.assertAlmostEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 5]), 51.20,
         places=2)
Пример #16
0
 def test_two_each_of_first_4_books_and_1_copy_each_of_rest(self):
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5]), 5560)
Пример #17
0
 def test_two_copies_of_each_book(self):
     self.assertAlmostEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5]), 60.00,
         places=2)
Пример #18
0
 def test_four_groups_of_4_are_cheaper_than_2_groups_each_of_5_and_3(self):
     self.assertEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5]),
         10240)
Пример #19
0
 def test_only_a_single_book(self):
     self.assertAlmostEqual(calculate_total([1]), 8.00,
                            places=2)
Пример #20
0
 def test_two_groups_of_4_is_cheaper_than_group_of_5_plus_group_of_3(self):
     print(
         "test_two_groups_of_4_is_cheaper_than_group_of_5_plus_group_of_3")
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 5]), 5120)
Пример #21
0
 def test_two_of_the_same_book(self):
     self.assertAlmostEqual(calculate_total([2, 2]), 16.00, places=2)
Пример #22
0
 def test_three_each_of_first_2_books_and_2_each_of_remaining_books(self):
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2]),
                      7520)
Пример #23
0
 def test_empty_basket(self):
     self.assertAlmostEqual(calculate_total([]), 0.00, places=2)
Пример #24
0
 def test_only_a_single_book(self):
     self.assertEqual(calculate_total([1]), 800)
Пример #25
0
 def test_two_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2]), 15.20, places=2)
Пример #26
0
 def test_empty_basket(self):
     self.assertEqual(calculate_total([]), 0)
Пример #27
0
 def test_three_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2, 3]), 21.60, places=2)
Пример #28
0
 def test_three_different_books(self):
     self.assertEqual(calculate_total([1, 2, 3]), 2160)
Пример #29
0
 def test_four_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2, 3, 4]), 25.60, places=2)
Пример #30
0
 def test_five_different_books(self):
     self.assertEqual(calculate_total([1, 2, 3, 4, 5]), 3000)
Пример #31
0
 def test_five_different_books(self):
     self.assertAlmostEqual(calculate_total([1, 2, 3, 4, 5]),
                            30.00,
                            places=2)
Пример #32
0
 def test_group_of_4_plus_group_of_2_is_cheaper_than_2_groups_of_3(self):
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 4]), 4080)
Пример #33
0
 def test_two_groups_of_4_is_cheaper_than_group_of_5_plus_group_of_3(self):
     self.assertAlmostEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 5]),
                            51.20,
                            places=2)
Пример #34
0
 def test_two_copies_of_each_book(self):
     self.assertEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5]), 6000)
Пример #35
0
 def test_two_copies_of_each_book(self):
     self.assertAlmostEqual(calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5]),
                            60.00,
                            places=2)
Пример #36
0
 def test_three_each_of_first_2_books_and_2_each_of_remaining_books(self):
     self.assertEqual(
         calculate_total([1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2]), 7520)
Пример #37
0
 def test_only_a_single_book(self):
     self.assertAlmostEqual(calculate_total([1]), 8.00, places=2)
Пример #38
0
 def test_only_a_single_book(self):
     self.assertEqual(calculate_total([1]), 800)
Пример #39
0
 def test_two_groups_of_4_is_cheaper_than_group_of_5_plus_group_of_3(self):
     self.assertEqual(calculate_total(), 5120)