Ejemplo n.º 1
0
 def test_progression_at_end(self):
     result = Progression.factory([3, 5, 8, 10, 12])
     self.assertEqual(str(result[1]), "8-12x2")
Ejemplo n.º 2
0
 def test_two(self):
     result = Progression.factory([3, 7])
     self.assertEqual(len(result), 1)
     self.assertEqual(str(result[0]), "3-7x4")
Ejemplo n.º 3
0
 def test_progression_at_start(self):
     result = Progression.factory([3, 5, 7, 10, 15])
     self.assertEqual(len(result), 2)
     self.assertEqual(str(result[0]), "3-7x2")
 def test_single(self):
     result = Progression.factory([3])
     self.assertEqual(len(result), 1)
     self.assertEqual(str(result[0]), "3")
Ejemplo n.º 5
0
 def test_single(self):
     result = Progression.factory([3])
     self.assertEqual(len(result), 1)
     self.assertEqual(str(result[0]), "3")
Ejemplo n.º 6
0
 def test_range_max_2(self):
     result = Progression.factory([2, 4, 6, 8, 10], max_size=2)
     self.assertEqual(len(result), 3)
Ejemplo n.º 7
0
 def test_seq_to_longest_progressions(self):
     s = Sequence.create("1-10, 14, 20-48x4")
     progs = Progression.factory(s)
     self.assertEqual(len(progs), 3)
 def test_range_max_2(self):
     result = Progression.factory([2, 4, 6, 8, 10], max_size=2)
     self.assertEqual(len(result), 3)
 def test_range_max_16(self):
     result = Progression.factory(xrange(2, 197, 3), max_size=16)
     self.assertEqual(len(result[0]), 16)
     self.assertEqual(len(result), 5)
 def test_order(self):
     numbers = [3, 5, 8, 10, 12]
     numbers.reverse()
     result = Progression.factory(numbers)
     self.assertEqual(str(result[0]), "3-5x2")
     self.assertEqual(str(result[1]), "8-12x2")
 def test_from_range(self):
     result = Progression.factory(xrange(2, 97, 3))
     self.assertEqual(len(result), 1)
     self.assertEqual(len(result[0]), 32)
 def test_progression_at_end(self):
     result = Progression.factory([3, 5, 8, 10, 12])
     self.assertEqual(str(result[1]), "8-12x2")
 def test_progression_at_start(self):
     result = Progression.factory([3, 5, 7, 10, 15])
     self.assertEqual(len(result), 2)
     self.assertEqual(str(result[0]), "3-7x2")
 def test_two(self):
     result = Progression.factory([3, 7])
     self.assertEqual(len(result), 1)
     self.assertEqual(str(result[0]), "3-7x4")
Ejemplo n.º 15
0
 def test_order(self):
     numbers = [3, 5, 8, 10, 12]
     numbers.reverse()
     result = Progression.factory(numbers)
     self.assertEqual(str(result[0]), "3-5x2")
     self.assertEqual(str(result[1]), "8-12x2")
 def test_seq_to_longest_progressions(self):
     s = Sequence.create("1-10, 14, 20-48x4")
     progs = Progression.factory(s)
     self.assertEqual(len(progs), 3)
Ejemplo n.º 17
0
 def test_from_range(self):
     result = Progression.factory(xrange(2, 97, 3))
     self.assertEqual(len(result), 1)
     self.assertEqual(len(result[0]), 32)
 def test_seq_to_limited_length_progressions(self):
     s = Sequence.create("1-10, 14, 20-48x4")
     progs = Progression.factory(s, max_size=4)
     self.assertEqual(len(progs), 6)
Ejemplo n.º 19
0
 def test_range_max_16(self):
     result = Progression.factory(xrange(2, 197, 3), max_size=16)
     self.assertEqual(len(result[0]), 16)
     self.assertEqual(len(result), 5)
Ejemplo n.º 20
0
 def test_empty(self):
     result = Progression.factory([])
     self.assertEqual(result, [])
Ejemplo n.º 21
0
 def test_seq_to_limited_length_progressions(self):
     s = Sequence.create("1-10, 14, 20-48x4")
     progs = Progression.factory(s, max_size=4)
     self.assertEqual(len(progs), 6)
 def test_empty(self):
     result = Progression.factory([])
     self.assertEqual(result, [])