'Force sorted responses by self.ipset._get_new/deleted_set_ips.
_get_new/deleted_set_ips use internally sets and return randomly
ordered responses. This method ensures sorted responses from them
in order to guarantee call order in self.ipset.set_members.'

def force_sorted_get_set_ips(self):

    original_get_new_set_ips = self.ipset._get_new_set_ips
    original_get_deleted_set_ips = self.ipset._get_deleted_set_ips
    def sorted_get_new_set_ips(set_name, expected_ips):
        unsorted = original_get_new_set_ips(set_name, expected_ips)
        return sorted(unsorted)
    def sorted_get_deleted_set_ips(set_name, expected_ips):
        unsorted = original_get_deleted_set_ips(set_name, expected_ips)
        return sorted(unsorted)
    mock.patch.object(self.ipset, '_get_new_set_ips', side_effect=sorted_get_new_set_ips).start()
    mock.patch.object(self.ipset, '_get_deleted_set_ips', side_effect=sorted_get_deleted_set_ips).start()
