In general, this change could use a lot more tests. Specifically though this looks to be testing the old scenario where the host still has the same products installed, which is not covering the situation this is being developed for.