コード例 #1
0
    def _fill_event(self, type, trigger, trigger_id):

        if type == u'tip' and trigger == 'Tip':

            receiver_dict = yield admin.get_receiver(self.createdReceiver['receiver_gus'])
            context_dict = yield admin.get_context(self.createdContext['context_gus'])
            notif_dict = yield admin.get_notification()

            yield admin.import_memory_variables()
            node_dict = yield admin.get_node()

            self.event = Event(
                type = u'tip',
                trigger = 'Tip',
                notification_settings = notif_dict,
                node_info = node_dict,
                receiver_info = receiver_dict,
                context_info = context_dict,
                plugin = None,
                trigger_info = {
                   'id': trigger_id,
                   'creation_date': pretty_date_time(datetime_now())
                }
            )

        elif type == u'comment' and trigger == 'Comment':
            raise AssertionError("Not yet managed Mock comments")
        elif type == u'file' and trigger == 'File':
            raise AssertionError("Not yet managed Mock files")
        else:
            raise AssertionError("type and trigger maybe refactored, but you're using it bad")
コード例 #2
0
ファイル: test_tip.py プロジェクト: rowanthorpe/GLBackend
 def update_node_properties(self):
     node_desc = yield admin.get_node()
     self.assertEqual(node_desc['postpone_superpower'], False)
     node_desc['postpone_superpower'] = True
     node_desc = yield admin.update_node(node_desc)
     self.assertEqual(node_desc['postpone_superpower'], True)