'Dump the passed in object to yaml, load it back up, dump again, compare.'

def _old_dump_load_cycle(self, obj):

    stream = io.StringIO()
    yaml_string = self._dump_string(obj, dumper=AnsibleDumper)
    self._dump_stream(obj, stream, dumper=AnsibleDumper)
    yaml_string_from_stream = stream.getvalue()
    stream.seek(0)
    loader = self._loader(stream)
    obj_from_stream = loader.get_data()
    stream_from_string = io.StringIO(yaml_string)
    loader2 = self._loader(stream_from_string)
    obj_from_string = loader2.get_data()
    stream_obj_from_stream = io.StringIO()
    stream_obj_from_string = io.StringIO()
    if PY3:
        yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper)
        yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper)
    else:
        yaml.dump(obj_from_stream, stream_obj_from_stream, Dumper=AnsibleDumper, encoding=None)
        yaml.dump(obj_from_stream, stream_obj_from_string, Dumper=AnsibleDumper, encoding=None)
    yaml_string_stream_obj_from_stream = stream_obj_from_stream.getvalue()
    yaml_string_stream_obj_from_string = stream_obj_from_string.getvalue()
    stream_obj_from_stream.seek(0)
    stream_obj_from_string.seek(0)
    if PY3:
        yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper)
        yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper)
    else:
        yaml_string_obj_from_stream = yaml.dump(obj_from_stream, Dumper=AnsibleDumper, encoding=None)
        yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper, encoding=None)
    assert (yaml_string == yaml_string_obj_from_stream)
    assert (yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string)
    assert (yaml_string == yaml_string_obj_from_stream == yaml_string_obj_from_string == yaml_string_stream_obj_from_stream == yaml_string_stream_obj_from_string)
    assert (obj == obj_from_stream)
    assert (obj == obj_from_string)
    assert (obj == yaml_string_obj_from_stream)
    assert (obj == yaml_string_obj_from_string)
    assert (obj == obj_from_stream == obj_from_string == yaml_string_obj_from_stream == yaml_string_obj_from_string)
    return {'obj': obj, 'yaml_string': yaml_string, 'yaml_string_from_stream': yaml_string_from_stream, 'obj_from_stream': obj_from_stream, 'obj_from_string': obj_from_string, 'yaml_string_obj_from_string': yaml_string_obj_from_string}
