'Test basic create.'

def test_create_key(self):

    key_name = 'generate_no_save'
    (tp_test, created_key) = self._get_mock_kp_for_create(key_name)
    self.patchobject(self.fake_keypairs, 'get', return_value=created_key)
    key_info = {'key_pair': 'info'}
    self.patchobject(created_key, 'to_dict', return_value=key_info)
    scheduler.TaskRunner(tp_test.create)()
    self.fake_keypairs.create.assert_called_once_with(name=key_name, public_key=None)
    self.assertEqual('', tp_test.FnGetAtt('private_key'))
    self.assertEqual('generated    test    public    key', tp_test.FnGetAtt('public_key'))
    self.assertEqual(key_info, tp_test.FnGetAtt('show'))
    self.assertEqual((tp_test.CREATE, tp_test.COMPLETE), tp_test.state)
    self.assertEqual(tp_test.resource_id, created_key.name)
