<s> import json <EOL> from functionaltests . api import base <EOL> class TestTypeDefinitions ( base . TestCase ) : <EOL> def _test_get_resource ( self , abs_url , msg , rtype , name ) : <EOL> url = abs_url [ len ( self . client . base_url ) + <NUM_LIT:1> : ] <EOL> resp , body = self . client . get ( url ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status , msg ) <EOL> resource = json . loads ( body ) <EOL> self . assertEqual ( rtype , resource [ '<STR_LIT:type>' ] ) <EOL> self . assertEqual ( name , resource [ '<STR_LIT:name>' ] ) <EOL> return body <EOL> def test_type_definitions ( self ) : <EOL> """<STR_LIT>""" <EOL> if base . config_set_as ( '<STR_LIT>' , False ) : <EOL> self . skipTest ( '<STR_LIT>' ) <EOL> resp , body = self . client . get ( '<STR_LIT>' ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status , '<STR_LIT>' ) <EOL> defs_dct = json . loads ( body ) <EOL> for link_dct in defs_dct [ '<STR_LIT>' ] : <EOL> msg = ( "<STR_LIT>" % <EOL> link_dct [ '<STR_LIT>' ] ) <EOL> body = self . _test_get_resource ( link_dct [ '<STR_LIT>' ] , <EOL> msg , <EOL> '<STR_LIT>' , <EOL> link_dct [ '<STR_LIT>' ] ) <EOL> def_dct = json . loads ( body ) <EOL> for adl_dct in def_dct [ '<STR_LIT>' ] : <EOL> msg = ( "<STR_LIT>" % <EOL> link_dct [ '<STR_LIT>' ] ) <EOL> self . _test_get_resource ( adl_dct [ '<STR_LIT>' ] , <EOL> msg , <EOL> '<STR_LIT>' , <EOL> adl_dct [ '<STR_LIT>' ] ) </s>
