Skip to content

Commit 5ac0c5d

Browse files
committed
Update the documentation to prepare for the PyKMIP 0.9 release
1 parent 9fac723 commit 5ac0c5d

File tree

4 files changed

+382
-135
lines changed

4 files changed

+382
-135
lines changed

docs/source/client.rst

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,6 @@ The configuration file can contain multiple settings blocks. Only one,
2929
blocks by simply providing the name of the block as the ``config``
3030
parameter (see below).
3131

32-
The client can also be configured manually via Python. The following example
33-
shows how to create the ``ProxyKmipClient`` in Python code, directly
34-
specifying the different configuration values:
35-
36-
.. code-block:: python
37-
38-
>>> import ssl
39-
>>> from kmip.pie.client import ProxyKmipClient
40-
>>> client = ProxyKmipClient(
41-
... hostname='127.0.0.1',
42-
... port=5696,
43-
... cert='/path/to/certificate/file',
44-
... key='/path/to/certificate/key/file',
45-
... ca='/path/to/ca/certificate/file',
46-
... ssl_version=ssl.PROTOCOL_SSLv23,
47-
... username='example_username',
48-
... password='example_password'
49-
... config='client'
50-
... )
51-
52-
Settings specified at runtime, as in the above example, will take precedence
53-
over the default values found in the configuration file.
54-
5532
The different configuration options are defined below:
5633

5734
* ``host``
@@ -109,6 +86,31 @@ The different configuration options are defined below:
10986
A string representing the password to use for KMIP requests. Optional
11087
depending on server access policies. Leave blank if not needed.
11188

89+
The client can also be configured manually via Python. The following example
90+
shows how to create the ``ProxyKmipClient`` in Python code, directly
91+
specifying the different configuration values:
92+
93+
.. code-block:: python
94+
95+
>>> import ssl
96+
>>> from kmip.pie.client import ProxyKmipClient
97+
>>> client = ProxyKmipClient(
98+
... hostname='127.0.0.1',
99+
... port=5696,
100+
... cert='/path/to/certificate/file',
101+
... key='/path/to/certificate/key/file',
102+
... ca='/path/to/ca/certificate/file',
103+
... ssl_version=ssl.PROTOCOL_SSLv23,
104+
... username='example_username',
105+
... password='example_password'
106+
... config='client',
107+
... config_file='/etc/pykmip/pykmip.conf',
108+
... kmip_version=enums.KMIPVersion.KMIP_1_2
109+
... )
110+
111+
Settings specified at runtime, as in the above example, will take precedence
112+
over the default values found in the configuration file.
113+
112114
Usage
113115
-----
114116

@@ -120,7 +122,7 @@ Class Documentation
120122
-------------------
121123
.. py:module:: kmip.pie.client
122124
123-
.. py:class:: ProxyKmipClient(hostname=None, port=None, cert=None, key=None, ca=None, ssl_version=None, username=None, password=None, config='client')
125+
.. py:class:: ProxyKmipClient(hostname=None, port=None, cert=None, key=None, ca=None, ssl_version=None, username=None, password=None, config='client', config_file=None, kmip_version=None)
124126
125127
A simplified KMIP client for conducting KMIP operations.
126128

@@ -153,6 +155,18 @@ Class Documentation
153155
file. Use to load a specific set of configuration settings from the
154156
configuration file, instead of specifying them manually. Optional,
155157
defaults to the default client section, 'client'.
158+
:param string config_file: The path to the PyKMIP client configuration
159+
file. Optional, defaults to None.
160+
:param enum kmip_version: A KMIPVersion enumeration specifying which KMIP
161+
version should be used to encode/decode request/response messages.
162+
Optional, defaults to None. If no value is specified, at request
163+
encoding time the client will default to KMIP 1.2.
164+
165+
.. py:attribute:: kmip_version
166+
167+
The KMIP version that should be used to encode/decode request/response
168+
messages. Must be a KMIPVersion enumeration. Can be accessed and
169+
modified at any time.
156170

157171
.. py:method:: open()
158172

docs/source/development.rst

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ PyKMIP, up to and including ``master``.
104104

105105
Running Tests
106106
-------------
107-
PyKMIP uses ``tox`` to manage testing across multiple Python versions. Test
108-
infrastructure currently supports Python 2.7, 3.4, 3.5, and 3.6. Additional
109-
test environments are provided for security, style, and documentation checks.
107+
PyKMIP uses ``tox`` to manage testing across multiple Python versions. ``tox``
108+
in turn uses ``pytest`` to run individual tests. Test infrastructure currently
109+
supports Python 2.7, 3.4, 3.5, 3.6, and 3.7. Additional test environments are
110+
provided for security, style, and documentation checks.
110111

111112
.. note::
112113

@@ -154,6 +155,16 @@ To test against a specific Python version (e.g., Python 2.7), run:
154155
155156
$ tox -e py27
156157
158+
To run an individual test suite method or class, use the ``pytest`` ``-k``
159+
flag to specify the name of the method or class to execute. For example, to
160+
run the ``TestProxyKmipClient`` test suite class under Python 2.7, run:
161+
162+
.. code-block:: console
163+
164+
$ tox -e py27 -- -k TestProxyKmipClient
165+
166+
For more information on the ``-k`` flag, see the `pytest`_ documentation.
167+
157168
Integration Tests
158169
~~~~~~~~~~~~~~~~~
159170
The integration test suite tests the functionality of the PyKMIP clients
@@ -184,6 +195,13 @@ following ``tox`` command will set up and execute the integration tests:
184195
185196
$ tox -r -e integration -- --config server_1
186197
198+
Like the unit tests, use the ``-k`` flag to specify a specific test suite
199+
method or class.
200+
201+
.. code-block:: console
202+
203+
$ tox -r -e integration -- --config server_1 -k TestProxyKmipClientIntegration
204+
187205
Functional Tests
188206
~~~~~~~~~~~~~~~~
189207
The functional test suite tests capabilities and functionality specific to
@@ -213,6 +231,13 @@ will set up and execute the functional tests:
213231
214232
$ tox -r -e functional -- --config-file /tmp/pykmip/client.conf
215233
234+
Like the unit and integration tests, use the ``-k`` flag to specify a specific
235+
test suite method or class.
236+
237+
.. code-block:: console
238+
239+
$ tox -r -e functional -- --config-file /tmp/pykmip/client.conf -k test_policy_caching
240+
216241
For more information on the testing tools used here, see the following
217242
resources:
218243

@@ -228,3 +253,4 @@ resources:
228253
.. _`flake8`: https://pypi.python.org/pypi/flake8
229254
.. _`bandit`: https://pypi.python.org/pypi/bandit
230255
.. _`SLUGS`: https://github.com/OpenKMIP/SLUGS
256+
.. _`pytest`: https://docs.pytest.org/en/latest/usage.html

0 commit comments

Comments
 (0)