Пример #1
0
 def test_tuple_input_raises_type_error(self):
     with self.assertRaises(TypeError):
         result = are_brackets_matched(('[', ']'))
Пример #2
0
 def test_empty_string(self):
     self.assertTrue(are_brackets_matched(''))
Пример #3
0
 def test_boolean_input_raises_type_error(self):
     with self.assertRaises(TypeError):
         result = are_brackets_matched(True)
Пример #4
0
 def test_list_input_raises_type_error(self):
     with self.assertRaises(TypeError):
         result = are_brackets_matched(['(', ')'])
Пример #5
0
 def test_tricky_invalid_string(self):
     self.assertFalse(are_brackets_matched('(((({{{{[[[[()]]]]}}}})))'))
Пример #6
0
 def test_integer_input_raises_type_error(self):
     chunk = 234523654436545
     with self.assertRaises(TypeError):
         result = are_brackets_matched(chunk)
Пример #7
0
 def test_string_with_numeric_characters(self):
     self.assertTrue(are_brackets_matched('345{}5436[](){}5556'))
Пример #8
0
 def test_invalid_large_string(self):
     self.assertFalse(are_brackets_matched('(((([[[{{{}}}]]]'))
Пример #9
0
 def test_valid_large_string(self):
     self.assertTrue(are_brackets_matched('(((([[[[{{{{}}}}]]]]))))'))
Пример #10
0
 def test_invalid_small_string(self):
     self.assertFalse(are_brackets_matched('({]'))
Пример #11
0
 def test_valid_small_string(self):
     self.assertTrue(are_brackets_matched('({})'))