<s> test_utils = local_import ( "<STR_LIT>" ) <EOL> find_JSON_format_data_structure = test_utils . find_JSON_format_data_structure <EOL> import unittest <EOL> def fail ( message ) : <EOL> def thrower ( * args , ** kwargs ) : <EOL> raise Exception ( message % dict ( args = args , kwargs = kwargs ) ) <EOL> return thrower <EOL> def ok ( * args , ** kwargs ) : <EOL> pass <EOL> class Test_find_JSON_format_data_structure ( unittest . TestCase ) : <EOL> def test_bad_javascript ( test ) : <EOL> test_utils . find_JSON_format_data_structure ( <EOL> string = "<STR_LIT>" , <EOL> name = "<STR_LIT:x>" , <EOL> found = fail ( "<STR_LIT>" ) , <EOL> not_found = fail ( "<STR_LIT>" ) , <EOL> cannot_parse_JSON = ok <EOL> ) <EOL> def test_missing_data_structure ( test ) : <EOL> test_utils . find_JSON_format_data_structure ( <EOL> string = "<STR_LIT>" , <EOL> name = "<STR_LIT:x>" , <EOL> found = fail ( "<STR_LIT>" ) , <EOL> not_found = ok , <EOL> cannot_parse_JSON = fail ( "<STR_LIT>" ) <EOL> ) <EOL> def test_found_data_structure ( test ) : <EOL> test_utils . find_JSON_format_data_structure ( <EOL> string = "<STR_LIT>" , <EOL> name = "<STR_LIT:x>" , <EOL> found = ok , <EOL> not_found = fail ( "<STR_LIT>" ) , <EOL> cannot_parse_JSON = fail ( "<STR_LIT>" ) <EOL> ) <EOL> def test_complex_name_data_structure ( test ) : <EOL> test_utils . find_JSON_format_data_structure ( <EOL> string = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> found = ok , <EOL> not_found = fail ( "<STR_LIT>" ) , <EOL> cannot_parse_JSON = fail ( "<STR_LIT>" ) <EOL> ) </s>
