EduploneExam/tests testResponse.py,1.1,1.2
Jens Klein <[email protected]>
| Newsgroups | gmane.comp.web.zope.eduplone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/eduplone/EduploneExam/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27907/tests
Modified Files:
testResponse.py
Log Message:
fixed code and tests
Index: testResponse.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/tests/testResponse.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** testResponse.py 15 Dec 2004 10:29:07 -0000 1.1
--- testResponse.py 15 Dec 2004 11:22:37 -0000 1.2
***************
*** 19,63 ****
def afterSetUp(self):
!
common.installWithinPortal(self.portal)
self.folder.invokeFactory('SimpleResponse', 'responseObj')
self.rObj=self.folder.responseObj
!
def makeQuestion(self):
self.folder.invokeFactory('MultipleChoiceQuestion', 'question')
self.qObj=self.folder.question
!
#testing
! def testSetGetQuestion(self):
! self.makeQuestion()
self.rObj.setQuestion(self.qObj)
getObj=self.rObj.getQuestion()
! self.failUnless(qObj.UID()==getObj.UID())
!
! def testGetQuestionTitle(self):
self.makeQuestion()
! self.qObj.setTitle('the title')
self.rObj.setQuestion(self.qObj)
title=self.rObj.getQuestionTitle()
self.failUnless(title=='the title')
!
! def testGetQuestionType(self):
self.makeQuestion()
self.rObj.setQuestion(self.qObj)
typ=self.rObj.getQuestionType()
self.failUnless(typ==self.qObj.getQuestionType())
!
def testSetResponseValues(self):
pass
!
def testGetResponseValues(self):
pass
!
def testSetGetScore(self):
self.rObj.setScore(10.5)
score=self.rObj.getScore()
self.failUnless(score==10.5)
!
!
def testGetMaxScore(self):
self.makeQuestion()
--- 19,62 ----
def afterSetUp(self):
! self.loginPortalOwner()
common.installWithinPortal(self.portal)
self.folder.invokeFactory('SimpleResponse', 'responseObj')
self.rObj=self.folder.responseObj
!
def makeQuestion(self):
self.folder.invokeFactory('MultipleChoiceQuestion', 'question')
self.qObj=self.folder.question
!
#testing
! def testSetGetQuestion(self):
! self.makeQuestion()
self.rObj.setQuestion(self.qObj)
getObj=self.rObj.getQuestion()
! self.failUnless(self.qObj.UID()==getObj.UID())
!
! def testGetQuestionTitle(self):
self.makeQuestion()
! self.qObj.setTitle('the title')
self.rObj.setQuestion(self.qObj)
title=self.rObj.getQuestionTitle()
self.failUnless(title=='the title')
!
! def testGetQuestionType(self):
self.makeQuestion()
self.rObj.setQuestion(self.qObj)
typ=self.rObj.getQuestionType()
self.failUnless(typ==self.qObj.getQuestionType())
!
def testSetResponseValues(self):
pass
!
def testGetResponseValues(self):
pass
!
def testSetGetScore(self):
self.rObj.setScore(10.5)
score=self.rObj.getScore()
self.failUnless(score==10.5)
!
def testGetMaxScore(self):
self.makeQuestion()
***************
*** 66,78 ****
mScore=self.rObj.getMaxScore()
self.failUnless(mScore==10.2)
!
! #self.loginPortalOwner()
!
!
!
! # self.failUnless(r==o['expectedValue'])
!
! self.portal.manage_delObjects(['ExamFolder'])
!
def test_suite():
--- 65,69 ----
mScore=self.rObj.getMaxScore()
self.failUnless(mScore==10.2)
!
def test_suite():
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/