On 01/29/2014 05:52 PM, Paulo Ricardo Paz Vital wrote:
On Wed, 2014-01-29 at 16:50 -0200, Aline Manera wrote:
> On 01/29/2014 04:37 PM, CrÃstian Viana wrote:
>
>> Am 29-01-2014 16:31, schrieb Aline Manera:
>>>> + def softwareupdate_lookup(self, *name):
>>>> + return self.host_swupdate.getUpdates()
>>>> +
>>>> + def softwareupdate_update(self, args=None):
>>>> + kimchi_log.info('Host is going to be updated.')
>>>> + self.host_swupdate.doUpdate()
>>> The mockmodel is a fake model.
>>> Which means we should not touch the system.
>>> You need to return default values there.
>> But this is a patch to src/kimchi/model.py, isn't it?
> Sorry, I commented in the model.py patch
>
> But the same code is in mockmodel.py so the comment is still valid.
The software update information is very volatile (sometimes I have
packages to update, sometimes not), so I think the better is not modify
mockmodel.py.
What do you think about it, Aline and Cristian?
No! You need to add the code for sotfware update also in mockmodel.py
And it should return constant values. That way we can test the REST API
and all flow in UI without modifying the system itself.
For the update() method you can log message and a sleep(10) to emulate
the update process.
BTW, I'm doing the modifications suggested by you on your reviews and
will submit a V2 tomorrow.
Best regards, Paulo.