Updated hostgroup test with  Factory

Updated existing tests with factory implementation and made all tests to data-driven. These changes covered issue #1062
:+1: