def test_create_from_packed_add_action_type_LogicAndNetwork(self):
        self.PREV = {"id": "slicer1->network1",
                     "type": "LogicAndNetwork",
                     "connection_type": "original",
                     "state": "initializing",
                     "logic_id": "slicer1",
                     "network_id": "network1"}
        self.CURR = {"id": "slicer1->network1",
                     "type": "LogicAndNetwork",
                     "connection_type": "original",
                     "state": "initializing",
                     "logic_id": "slicer1",
                     "network_id": "network1"}

        self.value = {"action": "add",
                      "prev": self.PREV,
                      "curr": self.CURR}

        self.result = ComponentConnectionChanged.create_from_packed(self.value)
        self.assertEqual(
            self.result._ComponentConnectionChanged__action, "add")
        self.assertEqual(
            self.result._ComponentConnectionChanged__prev, None)
        self.assertEqual(
            self.result._ComponentConnectionChanged__curr._property, self.CURR)
Esempio n. 2
0
    def test_create_from_packed_add_action_type_LogicAndNetwork(self):
        self.PREV = {
            "id": "slicer1->network1",
            "type": "LogicAndNetwork",
            "connection_type": "original",
            "state": "initializing",
            "logic_id": "slicer1",
            "network_id": "network1"
        }
        self.CURR = {
            "id": "slicer1->network1",
            "type": "LogicAndNetwork",
            "connection_type": "original",
            "state": "initializing",
            "logic_id": "slicer1",
            "network_id": "network1"
        }

        self.value = {"action": "add", "prev": self.PREV, "curr": self.CURR}

        self.result = ComponentConnectionChanged.create_from_packed(self.value)
        self.assertEqual(self.result._ComponentConnectionChanged__action,
                         "add")
        self.assertEqual(self.result._ComponentConnectionChanged__prev, None)
        self.assertEqual(
            self.result._ComponentConnectionChanged__curr._property, self.CURR)
Esempio n. 3
0
 def _do_event_componentconnectionchanged(self, event):
     msg = None
     try:
         msg = ComponentConnectionChanged.create_from_packed(event.body)
     except KeyError, err:
         logging.error("Receive Invalid ComponentConnectionChanged Message"
                       + " KeyError: " + str(err))
         return
    def test_create_from_packed_update_action_type_ComponentConnection(self):
        self.PREV = {"id": "slicer1->network1",
                     "type": "ComponentConnection",
                     "connection_type": "original",
                     "state": "initializing"}
        self.CURR = {"id": "slicer1->network1",
                     "type": "ComponentConnection",
                     "connection_type": "original",
                     "state": "initializing"}

        self.value = {"action": "update",
                      "prev": self.PREV,
                      "curr": self.CURR}

        self.result = ComponentConnectionChanged.create_from_packed(self.value)
        self.assertEqual(
            self.result._ComponentConnectionChanged__action, "update")
        self.assertEqual(
            self.result._ComponentConnectionChanged__prev._property, self.PREV)
        self.assertEqual(
            self.result._ComponentConnectionChanged__curr._property, self.CURR)
Esempio n. 5
0
    def test_create_from_packed_delete_action_type_ComponentConnection(self):
        self.PREV = {
            "id": "slicer1->network1",
            "type": "ComponentConnection",
            "connection_type": "original",
            "state": "initializing"
        }
        self.CURR = {
            "id": "slicer1->network1",
            "type": "ComponentConnection",
            "connection_type": "original",
            "state": "initializing"
        }

        self.value = {"action": "delete", "prev": self.PREV, "curr": self.CURR}

        self.result = ComponentConnectionChanged.create_from_packed(self.value)
        self.assertEqual(self.result._ComponentConnectionChanged__action,
                         "delete")
        self.assertEqual(
            self.result._ComponentConnectionChanged__prev._property, self.PREV)
        self.assertEqual(self.result._ComponentConnectionChanged__curr, None)
Esempio n. 6
0
 def setUp(self):
     self.target = ComponentConnectionChanged("add",
                                              self.Prev_ObjectProperty,
                                              self.Curr_ObjectProperty)