def test_update_readonly_lock(self): _group = InstanceGroup.create(self.context,self.tenant_id) InstanceGroup.set_readonly(self.context,_group.id,1) InstanceGroup.set_lock(self.context,_group.id,1) db_record = InstanceGroup.get_by_groupid(self.context,_group.id) self.assertEqual(1, db_record.readonly) self.assertEqual(1, db_record.lock)
def test_create(self): db_info = InstanceGroup.create(self.context,self.tenant_id) group_id = db_info.id db_record = InstanceGroup.get_by_groupid(self.context,group_id) print db_record.readonly,db_record.lock self.assertTrue(db_record)
def _create_group(self): group = InstanceGroup.create(self.context,self.tenant_id) return group.id
def test_list(self): InstanceGroup.create(self.context,self.tenant_id) db_list = InstanceGroup.list(self.context) self.assertEqual(1, db_list.count())
def test_delete(self): db_info = InstanceGroup.create(self.context,self.tenant_id) InstanceGroup.delete(self.context,db_info.id) self.assertRaises(exception.NotFound,InstanceGroup.get_by_groupid,self.context, db_info.id)