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)
def test_fullone(self): self.assertEqual((1, 2, 3, 3, 2, 1), s.reps([1,2,3,3,2,1]))
def test_full(self): self.assertEqual((1, 1, 1, 1), s.reps((1, 1, 1, 1)))
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)
def test_without_reps(self): self.assertEqual((), s.reps((1, 2, 3)))
def test_with_more_repetition(self): self.assertEqual((1, 2, 2, 1), s.reps((1, 2, 2, 3, 1, 7)))
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)
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]))
def test_bool(self): input_ = [False, True, False, False] output = (False, False, False) self.assertEqual(solution.reps(input_), output)
def test_empty(self): input_ = [1, 2, 3, 4, 5] self.assertEqual(s.reps(input_), ())
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)
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]) )
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)))
def test_some(self): self.assertEqual((4, 4, 4, 7, 7), s.reps([4,5,4,1,4,7,76,54,3,7]))
def test_with_bool(self): input_ = True, False, True, True output = True, True, True self.assertEqual(s.reps(input_), output)
def test_with_reps_only(self): self.assertEqual((1, 2, 1, 2, 1, 2), s.reps((1, 2, 1, 2, 1, 2)))
def test_with_dict(self): input_ = {}, {'a': 1}, {}, {'a': 2}, {'a': 1}, {} output = {}, {'a': 1}, {}, {'a': 1}, {} self.assertEqual(s.reps(input_), output)
def test_with_one_repetition(self): self.assertEqual((1, 1), s.reps((1, 2, 3, 1, 5)))
def test_full(self): self.assertEqual((1, 1, 1, 1), solution.reps((1, 1, 1, 1)))
def test_empty(self): self.assertEqual((), solution.reps((1, 2, 3, 4, 5, 6)))
def test_fullone(self): self.assertEqual((1, 2, 3, 3, 2, 1), solution.reps([1, 2, 3, 3, 2, 1]))
def test_empty_gain(self): self.assertEqual((), solution.reps([]))
def test_empty(self): self.assertEqual((), s.reps((1,2,3,4,5,6)))
def test_some(self): self.assertEqual((4, 4, 4, 7, 7), solution.reps([4, 5, 4, 1, 4, 7, 76, 54, 3, 7]))
def test_empty_gain(self): self.assertEqual((), s.reps([]))
def test_with_uniques_only(self): self.assertEqual(tuple(), s.reps([1, 2, 3, 4]))
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]) )
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,)) )