Пример #1
0
 def setAttributes(self, objRef, **attributes):
     string_attributes = {}
     for attribute, value in attributes.items():
         string_attributes[attribute] = py_list_to_tcl_list(
             value) if type(value) is list else value
     self.ixnCommand('setMultiAttribute', tcl_str(objRef),
                     get_args_pairs(string_attributes))
Пример #2
0
    def config(self, obj_ref, **attributes):
        """ Set or modifies one or more object attributes, or a relation.

        :param obj_ref: requested object reference.
        :param attributes: dictionary of {attributes: values} to configure.
        """

        self.stc_command('config', obj_ref, get_args_pairs(attributes))
Пример #3
0
    def subscribe(self, **arguments):
        """Subscribe to statistics view.

        :param arguments: subscribe command arguments.
            must arguments: parent, resultParent, configType, resultType
            + additional arguments.
        :return: ResultDataSet handler
        """
        return self.stc_command("subscribe", get_args_pairs(arguments))
Пример #4
0
    def add(self, parent, obj_type, **attributes):
        """ IXN API add command

        @param parent: object parent - object will be created under this parent.
        @param object_type: object type.
        @param attributes: additional attributes.
        @return: IXN object reference.
        """
        return self.ixnCommand('add', parent.obj_ref(), obj_type, get_args_pairs(attributes))
Пример #5
0
    def perform(self, command, **arguments):
        """ Execute a command.

        :param command: requested command.
        :param arguments: additional arguments.
        :return: value returned by 'perform command'.
        """

        return self.avl_command('perform', command, get_args_pairs(arguments))
Пример #6
0
    def perform(self, command, **arguments):
        """ Execute a command.

        :param command: requested command.
        :param arguments: additional arguments.
        :return: dictionary {attribute, value} as returned by 'perform command'.
        """

        rc = self.stc_command('perform', command, get_args_pairs(arguments))
        self.command_rc = {k[1:]: v for k, v in dict(zip(*[iter(tcl_list_2_py_list(rc))] * 2)).items()}
        return self.command_rc
Пример #7
0
    def create(self, obj_type, parent, **attributes):
        """ Creates one or more Spirent TestCenter Automation objects.

        :param obj_type: object type.
        :param parent: object parent - object will be created under this parent.
        :param attributes: additional attributes.
        :return: STC object reference.
        """

        return self.stc_command('create ' + obj_type + ' -under ' + parent.obj_ref(),
                                get_args_pairs(attributes))
Пример #8
0
 def avl_command(self, command, *attributes, **key_attributes):
     return self.eval('av::' + command + ' ' + ' '.join(attributes) + ' ' +
                      get_args_pairs(key_attributes))