Mailinglist Archive: yast-devel (121 mails)

< Previous Next >
Re: [yast-devel] testing functions using Pkg calls
On Ut 21. Jún 2011 16:36:01 Ladislav Slezak wrote:
Dne 21.6.2011 16:21, Jiri Suchomel napsal(a):
Would it make sense to revive this? Or to even enable real mocking of
Pkg? Or is it waste of the effort, which we should rather invest into
the new YaST++ project?

I'd rather invest the effort into YaST++, making Pkg bindings mockable
won't help us in YaST++ anyway.

As a workaround for now you can replace e.g.

boolean installed = Pkg::IsInstalled("foo");

by this

boolean installed = Mode::testMode() ? true : Pkg::IsInstalled("foo");

or wrap the Pkg:: call in a local function.


It's not a nice solution but should be sufficient in the current state...

This still should be possible. Did you try to use y2base -M option (namespace
overloading)?

Stano
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups