'Test error path when no role is found.'

def test_create_stack_user_error_norole(self):

    self._stubs_auth()
    ctx = utils.dummy_context()
    ctx.trust_id = None
    self.mock_ks_v3_client.roles = self.m.CreateMockAnything()
    self.mock_ks_v3_client.roles.list(name='heat_stack_user').AndReturn([])
    self.m.ReplayAll()
    heat_ks_client = heat_keystoneclient.KeystoneClient(ctx)
    err = self.assertRaises(exception.Error, heat_ks_client.create_stack_user, 'auser', password='password')
    self.assertIn("Can't    find    role    heat_stack_user", six.text_type(err))
