def job(mocker, hosts, inventory): j = Job(inventory=inventory, id=2) j._get_inventory_hosts = mocker.Mock(return_value=hosts) return j
def job2(mocker, hosts2, inventory, mock_cache): j = Job(inventory=inventory, id=3) j._get_inventory_hosts = mocker.Mock(return_value=hosts2) j._get_memcache_connection = mocker.Mock(return_value=mock_cache) return j