saltstack/salt — pull request #18262 by multani (2014-11-19 17:06:48+00:00)
Title: State `debconf.set_file` now accepts a template as a file

It follows the same convention as `file.managed` for example.

This also introduces a new function in the `debconfmod` module to set the
Debconf selections from a template or, as before, from a simple file.

I would gladly had some tests for this, but I struggled to do what I wanted. If somebody could point me out a way *not to call* `debconf-set-selections` (from `salt.modules.debconfmod._set_file`), that would be great.
I tried to mock this function in a integration test with `mock.patch()`, but the mock is never called, and I suspect this is due to the way the integration tests are working (the call to `_set_file` must be done **somewhere else**, like another process?). I also tried to do **unit** tests, but it looks like I have to mock the whole Salt universe to do something...

Fixes #7331