コード例 #1
0
 def test_quality_frames_new(self):
     # фреймов больше 10
     with self.assertRaises(Exception):
         get_score(game_result='12345123115472819-X44', status='new')
     # фреймов меньше 10
     with self.assertRaises(Exception):
         get_score(game_result='12345123115472819-', status='new')
コード例 #2
0
    def test_correct_input_score(self):
        result = get_score(game_result='3532X332/3/62--62X', status='old')
        self.assertEqual(result, 105)

        result = get_score(game_result='4-3/7/3/8/X711627-5', status='old')
        self.assertEqual(result, 113)

        result = get_score(game_result='3-6/5/9/5---1/--5-52', status='old')
        self.assertEqual(result, 80)
コード例 #3
0
    def test_correct_input_score_new(self):
        result = get_score(game_result='3532X332/3/62--62X', status='new')
        self.assertEqual(result, 90)

        result = get_score(game_result='4-3/7/3/8/X711627-5', status='new')
        self.assertEqual(result, 119)

        result = get_score(game_result='3-6/5/9/5---1/--5-52', status='new')
        self.assertEqual(result, 79)
コード例 #4
0
 def test_quality_skittles_in_frame(self):
     # проверка количества кегель во фрейме
     with self.assertRaises(Exception):
         get_score(game_result='12345523115472819-X', status='old')
     with self.assertRaises(Exception):
         get_score(game_result='12349923115472819-X', status='old')
コード例 #5
0
 def test_incorrect_symbols(self):
     # проверка о наличии двойного spare
     with self.assertRaises(Exception):
         get_score(game_result='1.5123115472819-X12', status='old')
コード例 #6
0
 def test_double_slash(self):
     # проверка о наличии двойного spare
     with self.assertRaises(Exception):
         get_score(game_result='12//5123115472819-X', status='old')
コード例 #7
0
 def test_position_slash(self):
     # проверка о наличии spare на первой позиции в фрейме
     with self.assertRaises(Exception):
         get_score(game_result='12/45123115472819-X', status='old')