コード例 #1
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: sample_test.py プロジェクト: idivanov/python-fmi
 def test_fullone(self):
     self.assertEqual((1, 2, 3, 3, 2, 1),
                      s.reps([1,2,3,3,2,1]))
コード例 #3
0
ファイル: sample_test.py プロジェクト: idivanov/python-fmi
 def test_full(self):
     self.assertEqual((1, 1, 1, 1), s.reps((1, 1, 1, 1)))
コード例 #4
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: sample_test2.py プロジェクト: idivanov/python-fmi
 def test_without_reps(self):
     self.assertEqual((), s.reps((1, 2, 3)))
コード例 #6
0
ファイル: sample_test2.py プロジェクト: idivanov/python-fmi
 def test_with_more_repetition(self):
     self.assertEqual((1, 2, 2, 1), s.reps((1, 2, 2, 3, 1, 7)))
コード例 #7
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 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
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 def test_bool(self):
     input_ = [False, True, False, False]
     output = (False, False, False)
     self.assertEqual(solution.reps(input_), output)
コード例 #10
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 def test_empty(self):
     input_ = [1, 2, 3, 4, 5]
     self.assertEqual(s.reps(input_), ())
コード例 #11
0
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 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
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 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
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 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
ファイル: sample_test.py プロジェクト: idivanov/python-fmi
 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
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 def test_with_bool(self):
     input_ = True, False, True, True
     output = True, True, True
     self.assertEqual(s.reps(input_), output)
コード例 #16
0
ファイル: test.py プロジェクト: d0ivanov/Python-2014-2015
 def test_with_reps_only(self):
     self.assertEqual((1, 2, 1, 2, 1, 2), s.reps((1, 2, 1, 2, 1, 2)))
コード例 #17
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: my_tests.py プロジェクト: mileto94/PythonFmi
 def test_with_more_repetition(self):
     self.assertEqual((1, 2, 2, 1), s.reps((1, 2, 2, 3, 1, 7)))
コード例 #19
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: sample_test2.py プロジェクト: idivanov/python-fmi
 def test_with_one_repetition(self):
     self.assertEqual((1, 1), s.reps((1, 2, 3, 1, 5)))
コード例 #21
0
ファイル: test_2.py プロジェクト: d0ivanov/Python-2014-2015
 def test_full(self):
     self.assertEqual((1, 1, 1, 1), solution.reps((1, 1, 1, 1)))
コード例 #22
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 def test_empty(self):
     input_ = [1, 2, 3, 4, 5]
     self.assertEqual(s.reps(input_), ())
コード例 #23
0
ファイル: test_2.py プロジェクト: d0ivanov/Python-2014-2015
 def test_empty(self):
     self.assertEqual((), solution.reps((1, 2, 3, 4, 5, 6)))
コード例 #24
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 def test_with_bool(self):
     input_ = True, False, True, True
     output = True, True, True
     self.assertEqual(s.reps(input_), output)
コード例 #25
0
ファイル: test_2.py プロジェクト: d0ivanov/Python-2014-2015
 def test_fullone(self):
     self.assertEqual((1, 2, 3, 3, 2, 1), solution.reps([1, 2, 3, 3, 2, 1]))
コード例 #26
0
ファイル: test_3.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: test_2.py プロジェクト: d0ivanov/Python-2014-2015
 def test_empty_gain(self):
     self.assertEqual((), solution.reps([]))
コード例 #28
0
ファイル: sample_test.py プロジェクト: idivanov/python-fmi
 def test_empty(self):
     self.assertEqual((), s.reps((1,2,3,4,5,6)))
コード例 #29
0
ファイル: test_2.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: sample_test.py プロジェクト: idivanov/python-fmi
 def test_empty_gain(self):
     self.assertEqual((), s.reps([]))
コード例 #31
0
ファイル: my_tests.py プロジェクト: mileto94/PythonFmi
 def test_without_reps(self):
     self.assertEqual((), s.reps((1, 2, 3)))
コード例 #32
0
ファイル: test.py プロジェクト: d0ivanov/Python-2014-2015
 def test_with_uniques_only(self):
     self.assertEqual(tuple(), s.reps([1, 2, 3, 4]))
コード例 #33
0
ファイル: my_tests.py プロジェクト: mileto94/PythonFmi
 def test_with_one_repetition(self):
     self.assertEqual((1, 1), s.reps((1, 2, 3, 1, 5)))
コード例 #34
0
ファイル: test.py プロジェクト: d0ivanov/Python-2014-2015
 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
ファイル: minh's_test.py プロジェクト: idivanov/python-fmi
 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,)) )