Thanks for these Francis. Here's a consolidated patch that adds a CiTestCase.tmp_cloud method to setup a temporary pathed Cloud/distro object so we don't have to magicMock them. Also I added some mocks of glob.glob for any handler calls because they were leaking into the underlying filesystem and attempting to remove the ssh keys.
I bet we can work out the sys_cfg params to tmp_cloud to avoid some of the normalize_users_groups mocking too, but I've got to bail for today on this and think it's good enough as is.
Thanks for these Francis. Here's a consolidated patch that adds a CiTestCase. tmp_cloud method to setup a temporary pathed Cloud/distro object so we don't have to magicMock them. Also I added some mocks of glob.glob for any handler calls because they were leaking into the underlying filesystem and attempting to remove the ssh keys.
http:// paste.ubuntu. com/p/yFt3MbHV7 W/
I bet we can work out the sys_cfg params to tmp_cloud to avoid some of the normalize_ users_groups mocking too, but I've got to bail for today on this and think it's good enough as is.