B.getAllDomains(&domains);
Document doc;
- doc.SetObject();
-
- Value jdomains;
- jdomains.SetArray();
+ doc.SetArray();
BOOST_FOREACH(const DomainInfo& di, domains) {
Value jdi;
jdi.AddMember("serial", di.serial, doc.GetAllocator());
jdi.AddMember("notified_serial", di.notified_serial, doc.GetAllocator());
jdi.AddMember("last_check", (unsigned int) di.last_check, doc.GetAllocator());
- jdomains.PushBack(jdi, doc.GetAllocator());
+ doc.PushBack(jdi, doc.GetAllocator());
}
- doc.AddMember("domains", jdomains, doc.GetAllocator());
resp->body = makeStringFromDocument(doc);
}
def test_ListZones(self):
r = self.session.get(self.url("/servers/localhost/zones"))
self.assertSuccessJson(r)
- data = r.json()
- self.assertIn('domains', data)
- domains = data['domains']
+ domains = r.json()
example_com = [domain for domain in domains if domain['name'] == u'example.com']
self.assertEquals(len(example_com), 1)
example_com = example_com[0]