def METHOD_NAME(create_temp_dir):
    newpath = create_temp_dir()
    fname = '%s/a1.json' % newpath
    file_exists = os.path.exists(fname)
    assert False == file_exists
    save_json_to_file({}, fname)
    file_exists = os.path.exists(fname)
    assert True == file_exists
    os.remove(fname)
    save_json_to_file(None, fname)
    file_exists = os.path.exists(fname)
    assert False == file_exists
    save_json_to_file({'a': 'b'}, fname)
    file_exists = os.path.exists(fname)
    assert True == file_exists
    os.remove(fname)
    fname = '%s/a/a1.json' % newpath
    file_exists = os.path.exists(fname)
    assert False == file_exists
    save_json_to_file({'a':'b'}, fname)
    file_exists = os.path.exists(fname)
    assert False == file_exists