def run_set_queries(resource_name, client, device_queries):
    base_path = '/sites/1'
    path = os.path.join(resource_name, 'query')
    base_uri = os.path.join(base_path, path)
    uri = base_uri + '?query='  # '/sites/1/devices/query?query='

    # Walk the query and filename, construct a URL w/ the query, load up the
    # file, call the URL w/ the client, and compare the return data to the
    # loaded data.
    for query, filename in device_queries:
        qs = urllib.quote_plus(query)  # 'foo=bar' => 'foo%3Dbar'
        url = uri + qs  # => /sites/1/devices/query?query=foo%3Dbar
        filepath = os.path.join(path, filename)  # devices/query/query1.json
        output = load_json(filepath)
        assert_success(
            client.get(url),
            output['data']
        )
Run set queries on the specified resource.
dataset/ETHPy150Open dropbox/hermes/tests/api_tests/util.py/run_set_queries