瀏覽代碼

Reduce failure to warning if query returns single object

Hamilton Turner 11 年之前
父節點
當前提交
6254569f71
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      toolset/benchmark/test_types/query_type.py

+ 6 - 1
toolset/benchmark/test_types/query_type.py

@@ -64,7 +64,12 @@ class QueryTestType(DBTestType):
     problems = []
     problems = []
 
 
     if type(response) != list:
     if type(response) != list:
-      return [('fail','Top-level JSON is an object, not an array', url)]
+      problems.append(('warn','Top-level JSON is an object, not an array', url))
+
+      # Verify the one object they gave us before returning
+      problems += self._verifyObject(response, url)
+
+      return problems
 
 
     if any(type(item) != dict for item in response):
     if any(type(item) != dict for item in response):
       problems.append(('fail','All items JSON array must be JSON objects', url))
       problems.append(('fail','All items JSON array must be JSON objects', url))