예제 #1
0
import sys as _sys
import os as _os
# pylint: disable=missing-docstring,superfluous-parens,no-self-use
import datetime
# pylint: disable=unused-import
import warnings  # noqa F401
import re
import getpass as _getpass

import argparse as _argparse
from tabulate import tabulate

# pylint: disable=wrong-import-position, wrong-import-order, invalid-name
from tests.utils import import_installed

pywbem = import_installed('pywbem')  # noqa: E402
from pywbem._cliutils import SmartFormatter as _SmartFormatter
from pywbem import WBEMConnection, Error, Uint64, TestClientRecorder
# pylint: enable=wrong-import-position, wrong-import-order, invalid-name

# Pegasus class/namespace to use for test
TEST_NAMESPACE = "test/TestProvider"
TEST_CLASSNAME = "TST_ResponseStressTestCxx"

# default values for the test parameters
DEFAULT_RESPONSE_SIZE = [100, 1000, 10000]
DEFAULT_RESPONSE_COUNT = [1, 100, 1000, 10000, 100000]
DEFAULT_PULL_SIZE = [1, 100, 1000]

STATS_LIST = []
예제 #2
0
import sys as _sys
import os as _os
import io
import time
import argparse as _argparse
import datetime
import pstats
import cProfile
import locale
from tabulate import tabulate
from pyinstrument import Profiler
import six

# pylint: disable=wrong-import-position, wrong-import-order, invalid-name
from tests.utils import import_installed
pywbem = import_installed('pywbem')
from pywbem import _tupletree, __version__  # noqa: E402
from pywbem._cliutils import SmartFormatter as _SmartFormatter  # noqa: E402
# pylint: enable=wrong-import-position, wrong-import-order, invalid-name

# In pywbem 0.13, parse_cim() changed from a function to a method:
try:
    from pywbem._tupleparse import parse_cim
except ImportError:
    from pywbem._tupleparse import TupleParser

    def parse_cim(tt):
        """Compatible parse_cim() function"""
        tp = TupleParser()
        return tp.parse_cim(tt)
예제 #3
0
파일: run_uprint.py 프로젝트: pywbem/pywbem
way to output the test string (e.g. normal print(), or raising an exception).
That is for manually figuring out the behavior for non-ASCII test strings.
"""

from __future__ import absolute_import, print_function

import sys
import locale
import traceback
import six

from tests.unittest.utils.unichr2 import unichr2

# pylint: disable=wrong-import-position, wrong-import-order, invalid-name
from tests.utils import import_installed
pywbem_mock = import_installed('pywbem_mock')
from pywbem_mock._wbemconnection_mock import _uprint  # noqa: E402
# pylint: enable=wrong-import-position, wrong-import-order, invalid-name

MAX_UNICODE_CP = 0x10FFFF  # Highest defined Unicode code point
MAX_UCS2_CP = 0xFFFF  # Highest Unicode code point in UCS-4


def print_debug_info():
    """
    Print debug information relevant for codepages.
    """
    print("Debug: sys.stdout: isatty=%r, encoding=%r" %
          (sys.stdout.isatty(), getattr(sys.stdout, 'encoding', None)),
          file=sys.stderr)
    print("Debug: locale.getpreferredencoding()=%r" %