Skip to content

Commit

Permalink
Merge 2ab0bb2 into 6f7cbbf
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-maier committed Aug 29, 2020
2 parents 6f7cbbf + 2ab0bb2 commit 6ca02ec
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions tests/unit/test_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@
FAKE_PEM_PATH = os.path.join(SCRIPT_DIR, FAKE_PEM)


TESTCASES_INITIALIZE = [
# TESTCASES for pywbem_server intitalize
TESTCASES_PYSVR_INIT = [
# Testcases for PywbemServer.__init__()
#
# Each list item is a testcase tuple with these items:
# * desc: Short testcase description.
# * kwargs: Keyword arguments for the test function and response:
# * init_kwargs: __init__ kwargs.
# * init_args: __init__() positional args.
# * init_kwargs: __init__() keyword args.
# * exp_attrs: Dict of expected attributes of resulting object.
# * exp_exc_types: Expected exception type(s), or None.
# * exp_warn_types: Expected warning type(s), or None.
Expand Down Expand Up @@ -446,11 +447,11 @@

@pytest.mark.parametrize(
"desc, kwargs, exp_exc_types, exp_warn_types, condition",
TESTCASES_INITIALIZE)
TESTCASES_PYSVR_INIT)
@simplified_test_function
def test_initialize(testcase, init_args, init_kwargs, exp_attrs):
def test_pysvr_init(testcase, init_args, init_kwargs, exp_attrs):
"""
Test object construction
Test function for PywbemServer.__init__().
"""
svr = PywbemServer(*init_args, **init_kwargs)

Expand All @@ -475,13 +476,13 @@ def test_initialize(testcase, init_args, init_kwargs, exp_attrs):
assert exp_attrs['server'] in repr_str


TESTCASES_CONNECT = [
# TESTCASES for pywbem_server connect
TESTCASES_PYSVR_CONNECT_ATTRS = [
# Testcases for PywbemServer.create_connection() for testing attrs
#
# Each list item is a testcase tuple with these items:
# * desc: Short testcase description.
# * kwargs: Keyword arguments for the test function and response:
# * init_kwargs: __init__ positional args.
# * init_kwargs: __init__() keyword args.
# * exp_attrs: Dict of expected attributes of resulting object.
# * exp_repr: string
# * exp_exc_types: Expected exception type(s), or None.
Expand All @@ -491,7 +492,6 @@ def test_initialize(testcase, init_args, init_kwargs, exp_attrs):
(
"Verify url arg only",
dict(
init_args=[],
init_kwargs=dict(
server='http://localhost',
),
Expand All @@ -512,7 +512,6 @@ def test_initialize(testcase, init_args, init_kwargs, exp_attrs):
(
"Verify with security params",
dict(
init_args=[],
init_kwargs=dict(
server='http://localhost',
user='fred',
Expand Down Expand Up @@ -540,13 +539,13 @@ def test_initialize(testcase, init_args, init_kwargs, exp_attrs):

@pytest.mark.parametrize(
"desc, kwargs, exp_exc_types, exp_warn_types, condition",
TESTCASES_CONNECT)
TESTCASES_PYSVR_CONNECT_ATTRS)
@simplified_test_function
def test_connect(testcase, init_args, init_kwargs, exp_attrs):
def test_pysvr_connect_attrs(testcase, init_kwargs, exp_attrs):
"""
Test object connect
Test function for PywbemServer.create_connection() for testing attrs.
"""
svr = PywbemServer(*init_args, **init_kwargs)
svr = PywbemServer(**init_kwargs)

# Create temp fake file.
# NOTE: We cannot use fixtures because we are using simplified_test_function
Expand Down

0 comments on commit 6ca02ec

Please sign in to comment.