def create_mock_key_provider(key_list):
 public_keys = {}
 for k in key_list:
  public_keys[k] = {'Fingerprint': k, 'Value': 'ffaa00'}
 key_provider = Mock()
 key_provider.get_public_keys.return_value = public_keys
 return key_provider

def create_mock_key_provider ( key_list ) : public_keys = { } for k in key_list : public_keys [ k ] = { 'Fingerprint' : k , 'Value' : 'ffaa00' } key_provider = Mock ( ) key_provider . get_public_keys . return_value = public_keys return key_provider
creates a mock key provider that yields keys for each in key_list .