<s> from oslo_serialization import jsonutils <EOL> from novaclient . tests . unit import fakes <EOL> from novaclient . tests . unit . fixture_data import base <EOL> class V1 ( base . Fixture ) : <EOL> base_url = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> super ( V1 , self ) . setUp ( ) <EOL> keypair = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> headers = self . json_headers <EOL> self . requests . register_uri ( '<STR_LIT:GET>' , self . url ( ) , <EOL> json = { '<STR_LIT>' : [ keypair ] } , <EOL> headers = headers ) <EOL> self . requests . register_uri ( '<STR_LIT:GET>' , self . url ( '<STR_LIT:test>' ) , <EOL> json = { '<STR_LIT>' : keypair } , <EOL> headers = headers ) <EOL> self . requests . register_uri ( '<STR_LIT>' , self . url ( '<STR_LIT:test>' ) , status_code = <NUM_LIT> , <EOL> headers = headers ) <EOL> def post_os_keypairs ( request , context ) : <EOL> body = jsonutils . loads ( request . body ) <EOL> assert list ( body ) == [ '<STR_LIT>' ] <EOL> fakes . assert_has_keys ( body [ '<STR_LIT>' ] , required = [ '<STR_LIT:name>' ] ) <EOL> return { '<STR_LIT>' : keypair } <EOL> self . requests . register_uri ( '<STR_LIT:POST>' , self . url ( ) , <EOL> json = post_os_keypairs , <EOL> headers = headers ) </s>
