Exemplo n.º 1
0
 def test_add(self):
     ps= self.get_citys()
     for p in ps:
         if p['id']<100:
             print p['name'],p['id']
             r,v=add(p['name'])
             cs = self.get_citys(p['id'])
             for c in cs:
                 print '**',c['name']
                 rr,vv = add(c['name'],v['_id'],1)
                 xs = self.get_citys(c['id'])
                 for x in xs:
                     print '****',x['name']
                     rrr,vvv = add(x['name'],vv['_id'],2)
Exemplo n.º 2
0
 def test_add(self):
     ps = self.get_citys()
     for p in ps:
         if p['id'] < 100:
             print p['name'], p['id']
             r, v = add(p['name'])
             cs = self.get_citys(p['id'])
             for c in cs:
                 print '**', c['name']
                 rr, vv = add(c['name'], v['_id'], 1)
                 xs = self.get_citys(c['id'])
                 for x in xs:
                     print '****', x['name']
                     rrr, vvv = add(x['name'], vv['_id'], 2)
Exemplo n.º 3
0
 def test_add_failure2(self):
     ret,entity = add(None)
     self.assertFalse(ret,msg='the city name should not be none')
Exemplo n.º 4
0
 def test_add_failure1(self):
     ret,entity = add(name=self.city_name,parent=self.parent_name)
     self.assertFalse(ret,msg='the city has already exist')
Exemplo n.º 5
0
 def test_add_accuracy1(self):
     ret, entity = add(name=self.city_name,parent=self.parent_name)
     self.assertTrue(ret, msg='the add city must be successful')
     self.assertIsNotNone(entity,msg='the city entity should not be null')
     self.__class__.entity_id = entity['_id']