Beispiel #1
0
 def generic_check(self, suite_string, desired):
     ast_tuple = parser.suite(suite_string).totuple()
     found, data = find_first_pattern(ast_tuple, indexed_array_pattern)
     subscript = data['subscript_list'][
         1]  # [0] is symbol, [1] is the subscript
     actual = slice_handler.slice_ast_to_dict(subscript)
     assert_equal(actual, desired, suite_string)
Beispiel #2
0
 def generic_check(self,suite_string,desired):
     import parser
     ast_tuple = parser.suite(suite_string).totuple()
     found, data = find_first_pattern(ast_tuple,indexed_array_pattern)
     subscript = data['subscript_list'][1]  # [0] is symbol, [1] is the supscript
     actual = slice_handler.slice_ast_to_dict(subscript)
     assert_equal(actual,desired,suite_string)