コード例 #1
0
  def testAddSynopsis(self):
    irs = ReferenceSynopsis(-1,self.rsData['theReference'],self.rsData['theSynopsis'],self.rsData['theDimension'],self.rsData['theActorType'],self.rsData['theActor'])
    b = Borg()
    b.dbProxy.addCharacteristicSynopsis(irs)

    ors = b.dbProxy.getCharacteristicSynopsis(self.rsData['theReference'])
    self.assertEqual(irs.reference(), ors.reference())
    self.assertEqual(irs.synopsis(), ors.synopsis())
    self.assertEqual(irs.dimension(), ors.dimension())
    self.assertEqual(irs.actorType(), ors.actorType())
    self.assertEqual(irs.actor(), ors.actor())
コード例 #2
0
    def __init__(self, parent, objt, charDetails=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           'Edit Reference Synopsis',
                           style=wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX,
                           size=(475, 250))
        self.theReference = objt.reference()
        self.theId = objt.id()
        self.theSynopsis = ''
        self.theDimension = ''
        self.theActorType = ''
        self.theActor = ''
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.panel = ReferenceSynopsisPanel(self)
        mainSizer.Add(self.panel, 1, wx.EXPAND)
        self.SetSizer(mainSizer)
        wx.EVT_BUTTON(self, REFERENCESYNOPSIS_BUTTONCOMMIT_ID, self.onCommit)

        if (objt.id() == -1):
            self.theCommitVerb = 'Create'
            if (charDetails != None):
                self.SetLabel = 'Create Characteristic Synopsis'
                charType = charDetails[0]
                tpName = charDetails[1]
                if (charType == 'persona'):
                    self.theActorType = 'persona'
                    self.theActor = tpName
            else:
                self.SetLabel = 'Create Reference Synopsis'
            objt = ReferenceSynopsis(-1, self.theReference, self.theSynopsis,
                                     self.theDimension, self.theActorType,
                                     self.theActor)
        else:
            if (charDetails != None):
                self.SetLabel = 'Edit Characteristic Synopsis'

            self.theReference = objt.reference()
            self.theSynopsis = objt.synopsis()
            self.theDimension = objt.dimension()
            self.theActorType = objt.actorType()
            self.theActor = objt.actor()
            self.theCommitVerb = 'Edit'
        self.panel.load(objt, charDetails)