Use mock instead of relying on command stderr

CLI execute tests execute a command with an invalid option name and
expect the option name to be echoed back. The output of the command
is not platform independent, it is different for instance on macosx.
Actually invoking the command is not a good practise in unit
tests as even in positive case the command may be installed in a
different path or have a different output.

Changing the tests so that they use mock on subprocess.Popen instead.

Closes-bug 1583205

Change-Id: I9c509359250d2eeb8942e1335e9f3d769e84415a
1 file changed