def testUpdateDataFlow(self): dfObs = [] for dfo in self.dfJson['theObstacles']: dfObs.append( (dfo['theName'], dfo['theKeyword'], dfo['theContext'])) idfp = DataFlowParameters( self.dfJson['theName'], self.dfJson['theType'], self.dfJson['theEnvironmentName'], self.dfJson['theFromName'], self.dfJson['theFromType'], self.dfJson['theToName'], self.dfJson['theToType'], self.dfJson['theAssets'], dfObs, self.dfJson['theTags']) b = Borg() b.dbProxy.addDataFlow(idfp) idfp.theName = 'Authenticate' b.dbProxy.updateDataFlow('authenticate', 'Psychosis', idfp) odfs = b.dbProxy.getDataFlows() odf = odfs[0] self.assertEqual(idfp.name(), odf.name()) self.assertEqual(idfp.type(), odf.type()) self.assertEqual(idfp.environment(), odf.environment()) self.assertEqual(idfp.fromName(), odf.fromName()) self.assertEqual(idfp.fromType(), odf.fromType()) self.assertEqual(idfp.toName(), odf.toName()) self.assertEqual(idfp.toType(), odf.toType()) self.assertEqual(idfp.assets(), odf.assets()) self.assertEqual(idfp.obstacles(), odf.obstacles()) self.assertEqual(idfp.tags(), odf.tags())
def testUpdateDataFlow(self): idfp = DataFlowParameters(self.dfJson['theName'],self.dfJson['theEnvironmentName'],self.dfJson['theFromName'],self.dfJson['theFromType'],self.dfJson['theToName'],self.dfJson['theToType'],self.dfJson['theAssets']) b = Borg() b.dbProxy.addDataFlow(idfp) idfp.theName = 'Authenticate' b.dbProxy.updateDataFlow('authenticate','Psychosis',idfp) odfs = b.dbProxy.getDataFlows() odf = odfs[0] self.assertEqual(idfp.name(),odf.name()) self.assertEqual(idfp.environment(),odf.environment()) self.assertEqual(idfp.fromName(),odf.fromName()) self.assertEqual(idfp.fromType(),odf.fromType()) self.assertEqual(idfp.toName(),odf.toName()) self.assertEqual(idfp.toType(),odf.toType()) self.assertEqual(idfp.assets(),odf.assets())
def testUpdateDataFlow(self): idfp = DataFlowParameters( self.dfJson['theName'], self.dfJson['theEnvironmentName'], self.dfJson['theFromName'], self.dfJson['theFromType'], self.dfJson['theToName'], self.dfJson['theToType'], self.dfJson['theAssets']) b = Borg() b.dbProxy.addDataFlow(idfp) idfp.theName = 'Authenticate' b.dbProxy.updateDataFlow('authenticate', 'Psychosis', idfp) odfs = b.dbProxy.getDataFlows() odf = odfs[0] self.assertEqual(idfp.name(), odf.name()) self.assertEqual(idfp.environment(), odf.environment()) self.assertEqual(idfp.fromName(), odf.fromName()) self.assertEqual(idfp.fromType(), odf.fromType()) self.assertEqual(idfp.toName(), odf.toName()) self.assertEqual(idfp.toType(), odf.toType()) self.assertEqual(idfp.assets(), odf.assets())