'Test Nova server doesn\'t set instance_user in build_userdata
Launching the instance should not pass any user name to
build_userdata. The default cloud-init user set up for the image
will be used instead.'

def test_empty_instance_user(self):

    return_server = self.fc.servers.list()[1]
    server = self._setup_test_server(return_server, 'without_user')
    metadata = server.metadata_get()
    build_data = self.patchobject(nova.NovaClientPlugin, 'build_userdata')
    scheduler.TaskRunner(server.create)()
    build_data.assert_called_with(metadata, 'wordpress', instance_user=None, user_data_format='HEAT_CFNTOOLS')
