Sorry, but %%1 is nothing against things which are done in YaST already. E.g. rewriting source code due to storing user configuration as is currently discussed elsewhere is very much more terrible than this. However it is not important.

What I wanted to say was that testing functionality which completely depends on output of different command using artificial data is not good approach in my POV. It doesn't depend if I test it by mocking target_output for getent or by supplying a value into the attribute of HostnameFromGetentOutput.