def setup_method(self):
        self.descr = ErrorDescription()
        self.descr.correlation_id = "correlationId"
        self.descr.code = "code"
        self.descr.message = "message"
        self.descr.status = 777
        self.descr.cause = "cause"
        self.descr.stack_trace = "stackTrace"

        map = StringValueMap()
        map.put('key', 'args')

        self.descr.details = map
    def from_tuples(*tuples: Any) -> 'CredentialParams':
        """
        Creates a new CredentialParams object filled with provided key-value pairs called tuples.
        Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.

        :param tuples: the tuples to fill a new CredentialParams object.

        :return: a new CredentialParams object.
        """
        map = StringValueMap.from_tuples_array(tuples)
        return CredentialParams(map)
    def from_string(line: str) -> 'CredentialParams':
        """
        Creates a new CredentialParams object filled with key-value pairs serialized as a string.

        :param line: a string with serialized key-value pairs as **"key1=value1;key2=value2;..."**
                     Example: **"Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"**

        :return: a new CredentialParams object.
        """
        map = StringValueMap.from_string(line)
        return CredentialParams(map)
Example #4
0
    def from_string(line):
        """
        Creates a new ConnectionParams object filled with key-value pairs serialized as a string.

        :param line: a string with serialized key-value pairs as "key1=value1;key2=value2;..."
                     Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"

        :return: a new ConnectionParams object.
        """
        map = StringValueMap.from_string(line)
        return ConnectionParams(map)
Example #5
0
    def __init__(self, name: str = None, description: str = None):
        """
        Creates a new instance of this context info.

        :param name: (optional) a context name.

        :param description: (optional) a human-readable description of the context.
        """
        self.__name: str = name or "unknown"
        self.__description: str = description
        self.__properties: StringValueMap = StringValueMap()
        self.__context_id = socket.gethostname()
        self.__start_time: datetime.datetime = datetime.datetime.now()
        self.__uptime: float = 0