예제 #1
0
 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)
예제 #2
0
    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)
예제 #3
0
 def _create_group(self):
     group = InstanceGroup.create(self.context,self.tenant_id)
     return group.id
예제 #4
0
 def test_list(self):
     InstanceGroup.create(self.context,self.tenant_id)
     db_list = InstanceGroup.list(self.context)
     self.assertEqual(1, db_list.count())
예제 #5
0
 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)