예제 #1
0
 def test_with_letters(self):
     input_ = [
         's', 'i', 'm', 'i', 't', 'l', 'i', 's', 'i', 'm', 'i', 't', 'l',
         'i', 'x', 'y', 'z'
     ]
     output = ('s', 'i', 'm', 'i', 't', 'l', 'i', 's', 'i', 'm', 'i', 't',
               'l', 'i')
     self.assertEqual(s.reps(input_), output)
예제 #2
0
 def test_fullone(self):
     self.assertEqual((1, 2, 3, 3, 2, 1),
                      s.reps([1,2,3,3,2,1]))
예제 #3
0
 def test_full(self):
     self.assertEqual((1, 1, 1, 1), s.reps((1, 1, 1, 1)))
예제 #4
0
 def test_with_int(self):
     input_ = 1, 2, 1, 3, 1, 4, 1, 5
     output = 1, 1, 1, 1
     self.assertEqual(s.reps(input_), output)
예제 #5
0
 def test_without_reps(self):
     self.assertEqual((), s.reps((1, 2, 3)))
예제 #6
0
 def test_with_more_repetition(self):
     self.assertEqual((1, 2, 2, 1), s.reps((1, 2, 2, 3, 1, 7)))
예제 #7
0
 def test_with_letters(self):
     input_ = ['s', 'i', 'm', 'i', 't', 'l', 'i',
               's', 'i', 'm', 'i', 't', 'l', 'i', 'x', 'y', 'z']
     output = ('s', 'i', 'm', 'i', 't', 'l', 'i',
               's', 'i', 'm', 'i', 't', 'l', 'i')
     self.assertEqual(s.reps(input_), output)
예제 #8
0
 def test_ones(self):
     self.assertEqual((1, 1, 1, 1, 1, 1, 1, 1), solution.reps((1, 1, 1, 1, 1, 1, 1, 1)))
     self.assertEqual((1, 1, 1, 1, 1, 1, 1, 1), solution.reps([1, 1, 1, 1, 1, 1, 1, 1]))
예제 #9
0
 def test_bool(self):
     input_ = [False, True, False, False]
     output = (False, False, False)
     self.assertEqual(solution.reps(input_), output)
예제 #10
0
 def test_empty(self):
     input_ = [1, 2, 3, 4, 5]
     self.assertEqual(s.reps(input_), ())
예제 #11
0
 def test_letters(self):
     input_ = ['f', 's', 's', 'w', 'b', 'l', 'f',
               'a', 'z', 'z', 'i', 't', 'm', 'd', 'x', 's', 't']
     output = ('f', 's', 's', 'f',
               'z', 'z', 't', 's', 't')
     self.assertEqual(solution.reps(input_), output)
예제 #12
0
 def test_example_case(self):
     self.assertEqual(
         (1, 5, 2, 2, 1, 2, 5, 1),
         solution.reps([1, 5, 2, 6, 90, 2, 4, 11, 1, 9, 0, 2, 5, 3, 1])
     )
예제 #13
0
 def test_non_empty(self):
     self.assertEqual((1, 1, 2, 2, 3, 3), solution.reps([1, 1, 2, 2, 3, 3]))
     self.assertEqual((6, 5, 6, 5), solution.reps([6, 1, 5, 6, 2, 3, 4, 5]))
     self.assertEqual((1, 2, 7, 1, 2, 7, 1, 9, 2, 9), solution.reps((1, 2, 7, 1, 2, 7, 1, 9, 2, 9)))
예제 #14
0
 def test_some(self):
     self.assertEqual((4, 4, 4, 7, 7), s.reps([4,5,4,1,4,7,76,54,3,7]))
예제 #15
0
 def test_with_bool(self):
     input_ = True, False, True, True
     output = True, True, True
     self.assertEqual(s.reps(input_), output)
예제 #16
0
 def test_with_reps_only(self):
     self.assertEqual((1, 2, 1, 2, 1, 2), s.reps((1, 2, 1, 2, 1, 2)))
예제 #17
0
 def test_with_int(self):
     input_ = 1, 2, 1, 3, 1, 4, 1, 5
     output = 1, 1, 1, 1
     self.assertEqual(s.reps(input_), output)
예제 #18
0
 def test_with_more_repetition(self):
     self.assertEqual((1, 2, 2, 1), s.reps((1, 2, 2, 3, 1, 7)))
예제 #19
0
 def test_with_dict(self):
     input_ = {}, {'a': 1}, {}, {'a': 2}, {'a': 1}, {}
     output = {}, {'a': 1}, {}, {'a': 1}, {}
     self.assertEqual(s.reps(input_), output)
예제 #20
0
 def test_with_one_repetition(self):
     self.assertEqual((1, 1), s.reps((1, 2, 3, 1, 5)))
예제 #21
0
 def test_full(self):
     self.assertEqual((1, 1, 1, 1), solution.reps((1, 1, 1, 1)))
예제 #22
0
 def test_empty(self):
     input_ = [1, 2, 3, 4, 5]
     self.assertEqual(s.reps(input_), ())
예제 #23
0
 def test_empty(self):
     self.assertEqual((), solution.reps((1, 2, 3, 4, 5, 6)))
예제 #24
0
 def test_with_bool(self):
     input_ = True, False, True, True
     output = True, True, True
     self.assertEqual(s.reps(input_), output)
예제 #25
0
 def test_fullone(self):
     self.assertEqual((1, 2, 3, 3, 2, 1), solution.reps([1, 2, 3, 3, 2, 1]))
예제 #26
0
 def test_with_dict(self):
     input_ = {}, {'a': 1}, {}, {'a': 2}, {'a': 1}, {}
     output = {}, {'a': 1}, {}, {'a': 1}, {}
     self.assertEqual(s.reps(input_), output)
예제 #27
0
 def test_empty_gain(self):
     self.assertEqual((), solution.reps([]))
예제 #28
0
 def test_empty(self):
     self.assertEqual((), s.reps((1,2,3,4,5,6)))
예제 #29
0
 def test_some(self):
     self.assertEqual((4, 4, 4, 7, 7),
                      solution.reps([4, 5, 4, 1, 4, 7, 76, 54, 3, 7]))
예제 #30
0
 def test_empty_gain(self):
     self.assertEqual((), s.reps([]))
예제 #31
0
 def test_without_reps(self):
     self.assertEqual((), s.reps((1, 2, 3)))
예제 #32
0
 def test_with_uniques_only(self):
     self.assertEqual(tuple(), s.reps([1, 2, 3, 4]))
예제 #33
0
 def test_with_one_repetition(self):
     self.assertEqual((1, 1), s.reps((1, 2, 3, 1, 5)))
예제 #34
0
 def test_example_case(self):
     self.assertEqual(
         (1, 4, 2, 2, 4, 1, 2, 1),
         s.reps([1, 4, 2, 6, 7, 2, 4, 11, 1, 9, 0, 2, 5, 3, 1])
     )
예제 #35
0
 def test_empty(self):
     self.assertEqual((), solution.reps((1, 2, 7, 43, 52, 61)) )
     self.assertEqual((), solution.reps(()) )
     self.assertEqual((), solution.reps([]) )
     self.assertEqual((), solution.reps([2]) )
     self.assertEqual((), solution.reps((1,)) )