Update to use fixed flights view

pull/1/merge
Daniel Richman 2012-09-08 22:51:10 +01:00
rodzic 64c18110fd
commit 86ba7e2dcc
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -291,12 +291,12 @@ vector<Json::Value> *Uploader::flights()
const Json::Value &key = row["key"], &doc = row["doc"];
bool doc_ok = doc.isObject() && doc.size();
bool key_ok = key.isArray() && key.size() == 3 && key[2u].isIntegral();
bool key_ok = key.isArray() && key.size() == 4 && key[3u].isIntegral();
if (!key_ok)
throw runtime_error("Invalid response: bad key in row");
bool is_pcfg = key[2u].asBool();
bool is_pcfg = key[3u].asBool();
if (!is_pcfg)
{

Wyświetl plik

@ -753,12 +753,13 @@ class TestCPPConnector:
pcfgs.append({"_id": "nonexistant_{0}".format(i)})
for i in xrange(100):
payloads = random.sample(pcfgs, random.randint(1, 5))
doc = {"_id": "flight_{0}", "type": "flight", "i": i,
f_id = "flight_{0}".format(i)
doc = {"_id": f_id, "type": "flight", "i": i,
"payloads": [p["_id"] for p in payloads]}
start = self.callbacks.fake_rfc3339(1000 + i)
end = self.callbacks.fake_rfc3339(2000 + i)
rows.append({"id": doc["_id"], "key": [end, start, 0],
rows.append({"id": f_id, "key": [end, start, f_id, 0],
"value": None, "doc": doc})
expect_payloads = []
@ -771,7 +772,7 @@ class TestCPPConnector:
else:
expect_payloads.append(p)
rows.append({"id": doc["_id"], "key": [end, start, 1],
rows.append({"id": f_id, "key": [end, start, f_id, 1],
"value": {"_id": p_id}, "doc": p})
doc = copy.deepcopy(doc)