Пример #1
0
 def test_triplets_for_large_numbers(self):
     expected = set([(1200, 14375, 14425),
                     (1875, 14000, 14125),
                     (5000, 12000, 13000),
                     (6000, 11250, 12750),
                     (7500, 10000, 12500)])
     self.assertEqual(triplets_with_sum(30000), expected)
 def test_triplets_for_large_numbers(self):
     expected = {(1200, 14375, 14425),
                 (1875, 14000, 14125),
                 (5000, 12000, 13000),
                 (6000, 11250, 12750),
                 (7500, 10000, 12500)}
     self.assertEqual(triplets_with_sum(30000), expected)
 def test_several_matching_triplets(self):
     expected = {(40, 399, 401),
                 (56, 390, 394),
                 (105, 360, 375),
                 (120, 350, 370),
                 (140, 336, 364),
                 (168, 315, 357),
                 (210, 280, 350),
                 (240, 252, 348)}
     self.assertEqual(triplets_with_sum(840), expected)
Пример #4
0
 def test_several_matching_triplets(self):
     expected = set([(40, 399, 401),
                     (56, 390, 394),
                     (105, 360, 375),
                     (120, 350, 370),
                     (140, 336, 364),
                     (168, 315, 357),
                     (210, 280, 350),
                     (240, 252, 348)])
     self.assertEqual(triplets_with_sum(840), expected)
 def test_triplets_for_large_number(self):
     self.assertCountEqual(
         triplets_with_sum(30000),
         [
             (1200, 14375, 14425),
             (1875, 14000, 14125),
             (5000, 12000, 13000),
             (6000, 11250, 12750),
             (7500, 10000, 12500),
         ],
     )
Пример #6
0
 def test_triplets_for_large_number(self):
     self.assertCountEqual(
         triplets_with_sum(30000),
         [
             [1200, 14375, 14425],
             [1875, 14000, 14125],
             [5000, 12000, 13000],
             [6000, 11250, 12750],
             [7500, 10000, 12500],
         ],
     )
Пример #7
0
 def test_several_matching_triplets(self):
     self.assertCountEqual(
         triplets_with_sum(840),
         [
             [40, 399, 401],
             [56, 390, 394],
             [105, 360, 375],
             [120, 350, 370],
             [140, 336, 364],
             [168, 315, 357],
             [210, 280, 350],
             [240, 252, 348],
         ],
     )
Пример #8
0
 def test_triplets_whose_sum_is_12(self):
     self.assertCountEqual(triplets_with_sum(12), [[3, 4, 5]])
 def test_two_matching_triplets(self):
     expected = {(9, 40, 41), (15, 36, 39)}
     self.assertEqual(triplets_with_sum(90), expected)
Пример #10
0
 def test_triplets_sum_1000(self):
     expected = set([(200, 375, 425)])
     self.assertEqual(triplets_with_sum(1000), expected)
Пример #11
0
 def test_no_matching_triplets_for_1001(self):
     self.assertCountEqual(triplets_with_sum(1001), [])
 def test_triplets_sum_12(self):
     expected = {(3, 4, 5)}
     self.assertEqual(triplets_with_sum(12), expected)
Пример #13
0
 def test_triplets_sum_12(self):
     expected = set([(3, 4, 5)])
     self.assertEqual(triplets_with_sum(12), expected)
Пример #14
0
 def test_two_matching_triplets(self):
     expected = set([(9, 40, 41), (15, 36, 39)])
     self.assertEqual(triplets_with_sum(90), expected)
Пример #15
0
 def test_no_triplet_exists(self):
     expected = set([])
     self.assertEqual(triplets_with_sum(1001), expected)
Пример #16
0
 def test_triplets_whose_sum_is_108(self):
     self.assertCountEqual(triplets_with_sum(108), [[27, 36, 45]])
Пример #17
0
 def test_triplets_whose_sum_is_1000(self):
     self.assertCountEqual(triplets_with_sum(1000), [[200, 375, 425]])
 def test_triplets_sum_108(self):
     expected = {(27, 36, 45)}
     self.assertEqual(triplets_with_sum(108), expected)
Пример #19
0
 def test_returns_all_matching_triplets(self):
     self.assertCountEqual(triplets_with_sum(90),
                           [[9, 40, 41], [15, 36, 39]])
 def test_triplets_sum_1000(self):
     expected = {(200, 375, 425)}
     self.assertEqual(triplets_with_sum(1000), expected)
 def test_no_triplet_exists(self):
     expected = set()
     self.assertEqual(triplets_with_sum(1001), expected)
Пример #22
0
 def test_triplets_sum_108(self):
     expected = set([(27, 36, 45)])
     self.assertEqual(triplets_with_sum(108), expected)