diff --git a/cafe/__init__.py b/cafe/__init__.py index 88e8883..8adc7da 100644 --- a/cafe/__init__.py +++ b/cafe/__init__.py @@ -14,6 +14,6 @@ __title__ = 'cafe' __author__ = 'Rackspace Cloud QE' __license__ = 'Apache License Version 2.0' -__copyright__ = 'Copyright 2013 Rackspace Inc.' +__copyright__ = 'Copyright 2015 Rackspace Inc.' __import__('pkg_resources').declare_namespace(__name__) diff --git a/cafe/common/reporting/metrics.py b/cafe/common/reporting/metrics.py index dd42a51..393f205 100644 --- a/cafe/common/reporting/metrics.py +++ b/cafe/common/reporting/metrics.py @@ -11,9 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -""" -@summary: Generic Classes for test statistics -""" from datetime import datetime import os import csv @@ -23,15 +20,7 @@ import sys class TestRunMetrics(object): """ - @summary: Generic Timer used to track any time span - @ivar start_time: Timestamp from the start of the timer - @type start_time: C{datetime} - @ivar stop_time: Timestamp of the end of the timer - @type stop_time: C{datetime} - @todo: This is a stop gap. It will be necessary to override large portions - of the runner and the default unittest.TestCase architecture to make - this auto-magically work with unittest properly. - This should be a child of unittest.TestResult + Contains test timing and results metrics for a test. """ def __init__(self): self.total_tests = 0 @@ -44,7 +33,7 @@ class TestRunMetrics(object): class TestResultTypes(object): """ - @summary: Types dictating an individual Test Case result + Types dictating an individual Test Case result @cvar PASSED: Test has passed @type PASSED: C{str} @cvar FAILED: Test has failed diff --git a/cafe/common/unicode.py b/cafe/common/unicode.py index 6380c0c..21d180e 100644 --- a/cafe/common/unicode.py +++ b/cafe/common/unicode.py @@ -10,90 +10,32 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - """ - @see: http://en.wikipedia.org/wiki/Unicode#Architecture_and_terminology +.. seealso:: http://en.wikipedia.org/wiki/Unicode#Architecture_and_terminology - Imports: - unicodedata - - - Classes: - UnicodeRange - A UnicodeRange object contains a start, end, and name attribute - which normally corresponds to the start and end integer for a - range of Unicode codepoints. - Each UnicodeRange object includes generators for performing common - functions on the codepoints in that integer range, such as: - - codepoints(): yeilds every integer in that Block's range. - - codepoint_names(): yeilds the Unicode name of every codepoint - integer in the Block's range. - - encoded_codepoints(): yeilds an encoded (UTF-8 by default) - string representation of the character - the codepoint represents. - - UnicodeRangeList - A list-like object normally made up of UnicodeRange objects. - Meant as a container for containing large, and/or disjointed ranges - Includes definitions for the UnicodeRange object methods - codepoints(), codepoint_names(), and encoded_codepoints() so that - a user can still iterate through the codepoints in the entire list, - even if the ranges are disjointed. This allows for creating - custom ranges for specific testing. - - Constants: - UNICODE_BLOCKS - A list-like object (UnicodeRangeList) made up of - UnicodeRange objects. Each UnicodeRange object in the list - corresponds to a named Unicode Block, and contains the start - and end integer for that Block. - - UNICODE_PLANES - A list-like object (UnicodeRangeList) made up of UnicodeRange - objects. It covers the same total range as UNICODE_BLOCKS, but is - instead organized by plane names instead of block names, which - results in fewer but larger ranges. - - UNICODE_STARTING_CODEPOINT - Integer denoting the first unicode codepoint - - UNICODE_ENDING_CODEPOINT - Integer denoting the last unicode codepoint - - PLANE_NAMES - Namespace (class) containing enums of all Unicode Plane names as - strings. - - BLOCK_NAMES - Namespace (class) containing enums of all Unicode Block names as - strings. - - Usage Exmaples: - Print all the characters in the "Thai" unicode block: +Usage Examples: +:: + # Print all the characters in the "Thai" unicode block for c in UNICODE_BLOCKS.get_range(BLOCK_NAMES.thai).encoded_codepoints(): print c - Iterate through all the integer codepoints in the "Thai" unicode block: - + # Iterate through all the integer codepoints in the "Thai" unicode block for i in UNICODE_BLOCKS.get_range(BLOCK_NAMES.thai).codepoints(): do_something(i) - Get a list of the names of all the characters in the "Thai" unicode block: - - [n for n in UNICODE_BLOCKS.get_range(BLOCK_NAMES.thai).codepoint_names()] + # Get a list of the names of all the characters in the "Thai" unicode block + [n for n in UNICODE_BLOCKS.get_range( + BLOCK_NAMES.thai).codepoint_names()] """ import six import unicodedata -# Integer denoting the first unicode codepoint +#: Integer denoting the first unicode codepoint UNICODE_STARTING_CODEPOINT = 0x0 -# Integer denoting the last unicode codepoint +#: Integer denoting the last unicode codepoint UNICODE_ENDING_CODEPOINT = 0x10FFFD # list-like object that iterates through named ranges of unicode codepoints @@ -106,7 +48,14 @@ UNICODE_PLANES = None class PLANE_NAMES(object): - """Namespace that defines all standard Unicode Plane names""" + """ + Namespace that defines all standard Unicode Plane names + + A list-like object (UnicodeRangeList) made up of UnicodeRange + objects. It covers the same total range as UNICODE_BLOCKS, but is + instead organized by plane names instead of block names, which + results in fewer but larger ranges. + """ basic_multilingual_plane = 'Basic Multilingual Plane' supplementary_multilingual_plane = 'Supplementary Multilingual Plane' supplementary_ideographic_plane = 'Supplementary Ideographic Plane' @@ -116,7 +65,14 @@ class PLANE_NAMES(object): class BLOCK_NAMES(object): - """Namespace that defines all standard Unicode Block names""" + """ + Namespace that defines all standard Unicode Block names + + A list-like object (UnicodeRangeList) made up of + UnicodeRange objects. Each UnicodeRange object in the list + corresponds to a named Unicode Block, and contains the start + and end integer for that Block. + """ basic_latin = "Basic Latin" c1_controls_and_latin_1_supplement = "C1 Controls and Latin-1 Supplement" latin_extended_a = "Latin Extended-A" @@ -417,6 +373,13 @@ class UnicodeRange(object): Iterable representation of a range of unicode codepoints. This can represent a standard Unicode Block, a standard Unicode Plane, or even a custom range. + + A UnicodeRange object contains a start, end, and name attribute + which normally corresponds to the start and end integer for a + range of Unicode codepoints. + + Each UnicodeRange object includes generators for performing common + functions on the codepoints in that integer range. """ def __init__(self, start, end, name): self.name = name @@ -429,24 +392,32 @@ class UnicodeRange(object): def codepoints(self): """ - Generator that yields the the integer value of all codepoints in - UnicodeRange + Generator that yields each codepoint in range as an integer. + + :rtype: generator, returns ints """ for codepoint in range(self.start, self.end + 1): yield codepoint def codepoint_names(self): """ - Generator that yields the string name (if available) of all codepoints - in UnicodeRange + Generator that yields the name of each codepoint in range as a string. + + If a name cannot be found, the codepoint's integer value is + returned in hexidecimal format as a string. + + :rtype: generator, returns strings """ for codepoint in self.codepoints(): yield codepoint_name(codepoint) def encoded_codepoints(self, encoding='utf-8'): """ - Generator that yields an encoded unicode string - representation of all codepoints in UnicodeRange + Generator that yields each codepoint name in range, encoded. + + :param encoding: the encoding to use on the string + :type encoding: string + :rtype: generator, returns unicode strings """ for codepoint in self.codepoints(): yield six.unichr(codepoint).encode(encoding) @@ -454,11 +425,11 @@ class UnicodeRange(object): class UnicodeRangeList(list): """ - List-like collection of UnicodeRange objects. - Represents a set of Unicode codepoint ranges, such as a custom non-linear - set of ranges, or a Unicode Plane. - @TODO: Override constructor so that only UnicodeRange objects can be - appended or extended? + A list-like for containing collections of UnicodeRange objects. + + Allows iteration through all codepoins in collected ranged, even if the + ranges are disjointed. Useful for for creating custom ranges for + specialized testing. """ def __str__(self): @@ -469,55 +440,73 @@ class UnicodeRangeList(list): def codepoints(self): """ - Generator that yields the the integer value of all codepoints in all - UnicodeRange objects in UnicodeRangeList + Generator that yields each codepoint in all ranges as an integer. + + :rtype: generator, returns ints """ + for unicode_range in self: for codepoint in unicode_range.codepoints(): yield codepoint def codepoint_names(self): """ - Generator that yields the string name (if available) of all codepoints - in all ranges in UnicodeRangeList. + Generator that yields the name of each codepoint in range as a string. If a name cannot be found, the codepoint's integer value is returned in hexidecimal format as a string. + + :rtype: generator, returns strings """ + for codepoint in self.codepoints(): yield codepoint_name(codepoint) def encoded_codepoints(self, encoding='utf-8'): """ - Generator that yields an encoded unicode string - representation of all codepoints in all UnicodeRange objects in - UnicodeRangeList + Generator that yields each codepoint name in range, encoded. + + :param encoding: the encoding to use on the string + :type encoding: string + :rtype: generator, returns unicode strings """ + for codepoint in self.codepoints(): yield six.unichr(codepoint).encode(encoding) def get_range(self, range_name): """ - Expects a Unicode Block name as a string. + Get a range of unicode codepoints by block name. - Returns a single UnicodeRange object representing the codepoints in the - unicode block range named range_name, if such a range exists in the - UnicodeRangeList, or None otherwise. + Returns a single :class:`UnicodeRange` object representing the + codepoints in the unicode block range named by :attr:`range_name`, + if such a range exists in the instance of :class:`UnicodeRangeList` + that :attr:`get_range` is being called from. + + :param range_name: name of the requested unicode block range. + :type range_name: string + :rtype: :class:`UnicodeRange` class instance, or None """ + for unicode_range in self: if unicode_range.name == range_name: return unicode_range - return None def get_range_list(self, range_name_list): """ - Expects a list of Unicode Block names as strings. + Get a list of ranges of unicode codepoints by block names. - Returns a UnicodeRangeList of UnicodeRange objects representing the - codepoints in the unicode block ranges with names in range_name_list, - if any such unicode block ranges exist in the UnicodeRangeList, or an - empty UnicodeRangeList otherewise. + Returns a single :class:`UnicodeRangeList` object representing the + codepoints in the unicode block ranges named by + :attr:`range_name_list`, if such ranges exists in the instance of + :class:`UnicodeRangeList` that :attr:`get_range_list` is being called + from. + + :param range_name_list: name(s) of requested unicode block ranges. + :type range_name_list: list of strings + :rtype: :class:`UnicodeRangeList` class instance, or :const:`None` """ + range_list = UnicodeRangeList() for unicode_range in self: if unicode_range.name in range_name_list: diff --git a/cafe/drivers/unittest/fixtures.py b/cafe/drivers/unittest/fixtures.py index 0018baf..eab8383 100644 --- a/cafe/drivers/unittest/fixtures.py +++ b/cafe/drivers/unittest/fixtures.py @@ -11,11 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -""" -@summary: Base Classes for Test Fixtures -@note: Corresponds DIRECTLY TO A unittest.TestCase -@see: http://docs.python.org/library/unittest.html#unittest.TestCase -""" import os import re import six @@ -27,17 +22,18 @@ from cafe.drivers.base import FixtureReporter class BaseTestFixture(unittest.TestCase): """ - @summary: This should be used as the base class for any unittest tests, - meant to be used instead of unittest.TestCase. - @see: http://docs.python.org/library/unittest.html#unittest.TestCase + Base class that all cafe unittest test fixtures should inherit from + + .. seealso:: http://docs.python.org/library/unittest.html#unittest.TestCase """ __test__ = True def shortDescription(self): """ - @summary: Returns a formatted description of the test + Returns a formatted description of the test """ + short_desc = None if os.environ.get("VERBOSE", None) == "true" and self._testMethodDoc: @@ -55,8 +51,7 @@ class BaseTestFixture(unittest.TestCase): @classmethod def assertClassSetupFailure(cls, message): """ - @summary: Use this if you need to fail from a Test Fixture's - setUpClass() method + Use this if you need to fail from a Test Fixture's setUpClass() """ cls.fixture_log.error("FATAL: %s:%s" % (cls.__name__, message)) raise AssertionError("FATAL: %s:%s" % (cls.__name__, message)) @@ -64,9 +59,9 @@ class BaseTestFixture(unittest.TestCase): @classmethod def assertClassTeardownFailure(cls, message): """ - @summary: Use this if you need to fail from a Test Fixture's - tearUpClass() method + Use this if you need to fail from a Test Fixture's tearDownClass() """ + cls.fixture_log.error("FATAL: %s:%s" % (cls.__name__, message)) raise AssertionError("FATAL: %s:%s" % (cls.__name__, message)) @@ -81,6 +76,7 @@ class BaseTestFixture(unittest.TestCase): @classmethod def tearDownClass(cls): cls._reporter.stop() + # Call super teardown after to avoid tearing down the class before we # can run our own tear down stuff. super(BaseTestFixture, cls).tearDownClass() @@ -98,6 +94,7 @@ class BaseTestFixture(unittest.TestCase): better pattern or working with the result object directly. This is related to the todo in L{TestRunMetrics} """ + if sys.version_info < (3, 4): if six.PY2: report = self._resultForDoCleanups @@ -125,12 +122,14 @@ class BaseTestFixture(unittest.TestCase): else: self._reporter.stop_test_metrics(self._testMethodName, 'Passed') - - # Let the base handle whatever hoodoo it needs + # Continue inherited tearDown() super(BaseTestFixture, self).tearDown() def _test_name_matches_result(self, name, test_result): - """Checks if a test result matches a specific test name.""" + """ + Checks if a test result matches a specific test name. + """ + if sys.version_info < (3, 4): # Try to get the result portion of the tuple try: @@ -148,6 +147,10 @@ class BaseTestFixture(unittest.TestCase): @classmethod def _do_class_cleanup_tasks(cls): + """ + Runs the tasks designated by the use of addClassCleanup + """ + for func, args, kwargs in reversed(cls._class_cleanup_tasks): cls.fixture_log.debug( "Running class cleanup task: {0}({1}, {2})".format( @@ -171,7 +174,9 @@ class BaseTestFixture(unittest.TestCase): @classmethod def addClassCleanup(cls, function, *args, **kwargs): - """Named to match unittest's addCleanup. + """ + Provides an addCleanup-like method that can be used in classmethods + ClassCleanup tasks run if setUpClass fails, or after tearDownClass. (They don't depend on tearDownClass running) """ @@ -181,8 +186,9 @@ class BaseTestFixture(unittest.TestCase): class BaseBurnInTestFixture(BaseTestFixture): """ - @summary: Base test fixture that allows for Burn-In tests + Base test fixture that allows for Burn-In tests """ + @classmethod def setUpClass(cls): super(BaseBurnInTestFixture, cls).setUpClass() diff --git a/cafe/engine/clients/commandline.py b/cafe/engine/clients/commandline.py index be26ecc..a54a15e 100644 --- a/cafe/engine/clients/commandline.py +++ b/cafe/engine/clients/commandline.py @@ -11,10 +11,6 @@ # License for the specific language governing permissions and limitations # under the License. -"""Provides low level connectivity to the commandline via popen() -@note: Primarily intended to serve as base classes for a specific - command line client Class -""" import os import sys from subprocess import Popen, PIPE, CalledProcessError @@ -26,18 +22,19 @@ from cafe.engine.models.commandline_response import CommandLineResponse class BaseCommandLineClient(BaseClient): - """Wrapper for driving/parsing a command line program - @ivar base_command: This processes base command string. (I.E. 'ls', 'pwd') - @type base_command: C{str} - @note: This class is dependent on a local installation of the wrapped - client process. The thing you run has to be there! + """ + Provides low level connectivity to the commandline via popen() + + Primarily intended to serve as base classes for a specific command line + client Class. This class is dependent on a local installation of the + wrapped client process. The thing you run has to be there! """ def __init__(self, base_command=None, env_var_dict=None): """ - @param base_command: This processes base command string. - (I.E. 'ls', 'pwd') - @type base_command: C{str} + :param base_command: This shell command to execute, e.g. 'ls' or 'pwd' + :param dict env_var_dict: Environment variables to inject into env + before execution. """ super(BaseCommandLineClient, self).__init__() diff --git a/cafe/engine/clients/sql.py b/cafe/engine/clients/sql.py index 55ec09e..63c0f57 100644 --- a/cafe/engine/clients/sql.py +++ b/cafe/engine/clients/sql.py @@ -21,12 +21,13 @@ class SQLClientException(Exception): class BaseSQLClient(BaseClient): """ - This is meant to be a base support client for DBAPI 2.0 clients. This - client is not meant to be used directly. New clients will extend this + Base support client for DBAPI 2.0 clients. + + This client is not meant to be used directly. New clients will extend this client and live inside of the individual CAFE. For more information on the DBAPI 2.0 standard please visit: - http://www.python.org/dev/peps/pep-0249 + .. seealso:: http://www.python.org/dev/peps/pep-0249 """ _log = cclogging.getLogger(__name__) @@ -38,16 +39,16 @@ class BaseSQLClient(BaseClient): """ Connects to self._driver with passed parameters - @param data_source_name: The data source name - @type data_source_name: String - @param user: Username - @type user: String - @param password: Password - @type password: String - @param host: Hostname - @type host: String - @param database: Database Name - @type database: String + :param data_source_name: The data source name + :type data_source_name: string + :param user: Username + :type user: string + :param password: Password + :type password: string + :param host: Hostname + :type host: string + :param database: Database Name + :type database: string """ if self._driver is None: message = 'Driver not set.' @@ -71,13 +72,13 @@ class BaseSQLClient(BaseClient): For more information on the execute command see: http://www.python.org/dev/peps/pep-0249/#id15 - @param operation: The operation being executed - @type operation: String - @param parameters: Sequence or map that wil be bound to variables in + :param operation: The operation being executed + :type operation: string + :param parameters: Sequence or map that wil be bound to variables in the operation - @type parameters: String or dictionary - @param cursor: A pre-existing cursor - @type cursor: object + :type parameters: string or dictionary + :param cursor: A pre-existing cursor + :type cursor: cursor object """ if self._connection is None: message = 'Connection not set.' @@ -99,13 +100,13 @@ class BaseSQLClient(BaseClient): For more information on the execute command see: http://www.python.org/dev/peps/pep-0249/#executemany - @param operation: The operation being executed - @type operation: String - @param seq_of_parameters: The sequence or mappings that will be run + :param operation: The operation being executed + :type operation: string + :param seq_of_parameters: The sequence or mappings that will be run against the operation - @type seq_of_parameters: String or object - @param cursor: A pre-existing cursor - @type cursor: object + :type seq_of_parameters: string or object + :param cursor: A pre-existing cursor + :type cursor: cursor object """ if self._connection is None: message = 'Connection not set.' diff --git a/docs/source/architecture/client.rst b/docs/source/architecture/client.rst index 1f920e9..e63fc59 100644 --- a/docs/source/architecture/client.rst +++ b/docs/source/architecture/client.rst @@ -11,27 +11,27 @@ Design ------ * Clients should be simple and focused on providing native access to foreign -functionality in a clean and easy to understand way. + functionality in a clean and easy to understand way. * A client should not make assumptions about how it will be used, beyond -those mandated by the foreign functionality. + those mandated by the foreign functionality. * A client should be able to stand on it's own, without requiring any -configuration or information beyond what is required for instantiation. + configuration or information beyond what is required for instantiation. Examples -------- * The HTTP client itself doesn't require any information to instantiate, -but an API client built using the HTTP client might require a URL and an auth -token, since it's purpose is to interact solely with the API located at that -URL. + but an API client built using the HTTP client might require a URL and an auth + token, since it's purpose is to interact solely with the API located at that + URL. * The commandline client offers logging, a uniform request/response model, and -both synchronous and asynchronous requests on top of python's Popen method, -but doesn't seek to expose functionality beyond running cli commands. The -client deals with Popen and provides a simple way to get stdout, stderr, and -stdin from a single command send to the local commandline. The client itself -can be instantiated with a base command and used as an ad hoc interface for a -specific commandline program, or left without a base command and used as an -interface for the underlying shell. \ No newline at end of file + both synchronous and asynchronous requests on top of python's Popen method, + but doesn't seek to expose functionality beyond running cli commands. The + client deals with Popen and provides a simple way to get stdout, stderr, and + stdin from a single command send to the local commandline. The client itself + can be instantiated with a base command and used as an ad hoc interface for a + specific commandline program, or left without a base command and used as an + interface for the underlying shell. \ No newline at end of file diff --git a/docs/source/cafe/cafe.common.reporting.rst b/docs/source/cafe/cafe.common.reporting.rst new file mode 100644 index 0000000..6cdf7cc --- /dev/null +++ b/docs/source/cafe/cafe.common.reporting.rst @@ -0,0 +1,50 @@ +cafe.common.reporting package +============================= + +cafe.common.reporting.base_report module +---------------------------------------- + +.. automodule:: cafe.common.reporting.base_report + :members: + :undoc-members: + :show-inheritance: + +cafe.common.reporting.cclogging module +-------------------------------------- + +.. automodule:: cafe.common.reporting.cclogging + :members: + :undoc-members: + :show-inheritance: + +cafe.common.reporting.json_report module +---------------------------------------- + +.. automodule:: cafe.common.reporting.json_report + :members: + :undoc-members: + :show-inheritance: + +cafe.common.reporting.metrics module +------------------------------------ + +.. automodule:: cafe.common.reporting.metrics + :members: + :undoc-members: + :show-inheritance: + +cafe.common.reporting.reporter module +------------------------------------- + +.. automodule:: cafe.common.reporting.reporter + :members: + :undoc-members: + :show-inheritance: + +cafe.common.reporting.xml_report module +--------------------------------------- + +.. automodule:: cafe.common.reporting.xml_report + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.common.rst b/docs/source/cafe/cafe.common.rst new file mode 100644 index 0000000..90f0a9d --- /dev/null +++ b/docs/source/cafe/cafe.common.rst @@ -0,0 +1,27 @@ +cafe.common package +=================== + +.. toctree:: + + cafe.common.reporting + +cafe.common.unicode +------------------- + +.. autodata:: cafe.common.unicode.PLANE_NAMES +.. autodata:: cafe.common.unicode.BLOCK_NAMES +.. data:: cafe.common.unicode.UNICODE_BLOCKS(cafe.common.unicode.UnicodeRangeList) + + list-like object that iterates through named ranges of unicode codepoints + Instantiated at runtime (when imported) near the bottom of this file + +.. data:: cafe.common.unicode.UNICODE_PLANES(cafe.common.unicode.UnicodeRangeList) + + list-like object that iterates through ranges of ranges of unicode codepoints + Instantiated at runtime (when imported) near the bottom of this file + +.. automodule:: cafe.common.unicode + :members: + :undoc-members: + :show-inheritance: + :exclude-members: PLANE_NAMES, BLOCK_NAMES, UNICODE_BLOCKS, UNICODE_PLANES \ No newline at end of file diff --git a/docs/source/cafe/cafe.configurator.rst b/docs/source/cafe/cafe.configurator.rst new file mode 100644 index 0000000..1decd4d --- /dev/null +++ b/docs/source/cafe/cafe.configurator.rst @@ -0,0 +1,18 @@ +cafe.configurator package +========================= + +cafe.configurator.cli module +---------------------------- + +.. automodule:: cafe.configurator.cli + :members: + :undoc-members: + :show-inheritance: + +cafe.configurator.managers module +--------------------------------- + +.. automodule:: cafe.configurator.managers + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.drivers.behave.rst b/docs/source/cafe/cafe.drivers.behave.rst new file mode 100644 index 0000000..d3abd30 --- /dev/null +++ b/docs/source/cafe/cafe.drivers.behave.rst @@ -0,0 +1,10 @@ +cafe.drivers.behave package +=========================== + +cafe.drivers.behave.runner module +--------------------------------- + +.. automodule:: cafe.drivers.behave.runner + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.drivers.lettuce.rst b/docs/source/cafe/cafe.drivers.lettuce.rst new file mode 100644 index 0000000..8fd2e6d --- /dev/null +++ b/docs/source/cafe/cafe.drivers.lettuce.rst @@ -0,0 +1,10 @@ +cafe.drivers.lettuce package +============================ + +Module contents +--------------- + +.. automodule:: cafe.drivers.lettuce + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/cafe/cafe.drivers.pyvows.rst b/docs/source/cafe/cafe.drivers.pyvows.rst new file mode 100644 index 0000000..9b0c3f6 --- /dev/null +++ b/docs/source/cafe/cafe.drivers.pyvows.rst @@ -0,0 +1,10 @@ +cafe.drivers.pyvows package +=========================== + +cafe.drivers.pyvows.runner module +--------------------------------- + +.. automodule:: cafe.drivers.pyvows.runner + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.drivers.rst b/docs/source/cafe/cafe.drivers.rst new file mode 100644 index 0000000..f4a27d5 --- /dev/null +++ b/docs/source/cafe/cafe.drivers.rst @@ -0,0 +1,21 @@ +cafe.drivers package +==================== + +Subpackages +----------- + +.. toctree:: + + cafe.drivers.behave + cafe.drivers.lettuce + cafe.drivers.pyvows + cafe.drivers.specter + cafe.drivers.unittest + +cafe.drivers.base module +------------------------ + +.. automodule:: cafe.drivers.base + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.drivers.specter.rst b/docs/source/cafe/cafe.drivers.specter.rst new file mode 100644 index 0000000..5c131a0 --- /dev/null +++ b/docs/source/cafe/cafe.drivers.specter.rst @@ -0,0 +1,10 @@ +cafe.drivers.specter package +============================ + +cafe.drivers.specter.runner module +---------------------------------- + +.. automodule:: cafe.drivers.specter.runner + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.drivers.unittest.rst b/docs/source/cafe/cafe.drivers.unittest.rst new file mode 100644 index 0000000..d2902e6 --- /dev/null +++ b/docs/source/cafe/cafe.drivers.unittest.rst @@ -0,0 +1,50 @@ +cafe.drivers.unittest package +============================= + +cafe.drivers.unittest.datasets module +------------------------------------- + +.. automodule:: cafe.drivers.unittest.datasets + :members: + :undoc-members: + :show-inheritance: + +cafe.drivers.unittest.decorators module +--------------------------------------- + +.. automodule:: cafe.drivers.unittest.decorators + :members: + :undoc-members: + :show-inheritance: + +cafe.drivers.unittest.fixtures module +------------------------------------- + +.. automodule:: cafe.drivers.unittest.fixtures + :members: + :undoc-members: + :show-inheritance: + +cafe.drivers.unittest.parsers module +------------------------------------ + +.. automodule:: cafe.drivers.unittest.parsers + :members: + :undoc-members: + :show-inheritance: + +cafe.drivers.unittest.runner module +----------------------------------- + +.. automodule:: cafe.drivers.unittest.runner + :members: + :undoc-members: + :show-inheritance: + +cafe.drivers.unittest.suite module +---------------------------------- + +.. automodule:: cafe.drivers.unittest.suite + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.engine.clients.rst b/docs/source/cafe/cafe.engine.clients.rst new file mode 100644 index 0000000..33f5dc5 --- /dev/null +++ b/docs/source/cafe/cafe.engine.clients.rst @@ -0,0 +1,34 @@ +cafe.engine.clients package +=========================== + +cafe.engine.clients.base module +------------------------------- + +.. automodule:: cafe.engine.clients.base + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.clients.commandline module +-------------------------------------- + +.. automodule:: cafe.engine.clients.commandline + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.clients.ping module +------------------------------- + +.. automodule:: cafe.engine.clients.ping + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.clients.sql module +------------------------------ + +.. automodule:: cafe.engine.clients.sql + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.engine.models.rst b/docs/source/cafe/cafe.engine.models.rst new file mode 100644 index 0000000..b4faafa --- /dev/null +++ b/docs/source/cafe/cafe.engine.models.rst @@ -0,0 +1,34 @@ +cafe.engine.models package +========================== + +cafe.engine.models.base module +------------------------------ + +.. automodule:: cafe.engine.models.base + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.models.behavior_response module +------------------------------------------- + +.. automodule:: cafe.engine.models.behavior_response + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.models.commandline_response module +---------------------------------------------- + +.. automodule:: cafe.engine.models.commandline_response + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.models.data_interfaces module +----------------------------------------- + +.. automodule:: cafe.engine.models.data_interfaces + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.engine.rst b/docs/source/cafe/cafe.engine.rst new file mode 100644 index 0000000..4377f72 --- /dev/null +++ b/docs/source/cafe/cafe.engine.rst @@ -0,0 +1,34 @@ +cafe.engine package +=================== + +Subpackages +----------- + +.. toctree:: + + cafe.engine.clients + cafe.engine.models + +cafe.engine.behaviors module +---------------------------- + +.. automodule:: cafe.engine.behaviors + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.config module +------------------------- + +.. automodule:: cafe.engine.config + :members: + :undoc-members: + :show-inheritance: + +cafe.engine.provider module +--------------------------- + +.. automodule:: cafe.engine.provider + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/cafe/cafe.rst b/docs/source/cafe/cafe.rst new file mode 100644 index 0000000..7384dcc --- /dev/null +++ b/docs/source/cafe/cafe.rst @@ -0,0 +1,9 @@ +cafe +==== + +.. toctree:: + + cafe.common + cafe.configurator + cafe.drivers + cafe.engine \ No newline at end of file diff --git a/docs/source/cafe/index.rst b/docs/source/cafe/index.rst new file mode 100644 index 0000000..9dca1e0 --- /dev/null +++ b/docs/source/cafe/index.rst @@ -0,0 +1,16 @@ +====================== +OpenCAFE Documentation +====================== + +.. toctree:: + +.. toctree:: + :maxdepth: 4 + + cafe + + +Index +================== + +* :ref:`genindex` \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 6c96bc9..1b0f0de 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,15 @@ import sphinx_rtd_theme +import sys +import os +import shlex + +package_path = os.path.abspath("../../../opencafe") +sys.path.append(package_path) extensions = [ 'sphinx.ext.autodoc', + 'sphinx.ext.todo', + 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. @@ -15,19 +23,19 @@ master_doc = 'index' # General information about the project. project = u'OpenCAFE' -copyright = u'2013, Rackspace' +copyright = u'2015, RackspaceQE' # The short X.Y version. -version = '0.1.0' +version = '0.2.0' # The full version, including alpha/beta/rc tags. -release = '0.1.0' +release = '0.2.0' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'friendly' +pygments_style = 'monokai' # -- Options for HTML output ---------------------------------------------- @@ -69,6 +77,11 @@ man_pages = [ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) -texinfo_documents = [('index', 'OpenCAFE', u'OpenCAFE Documentation', - u'Rackspace', 'OpenCAFE', - 'One line description of project.', 'Miscellaneous')] +texinfo_documents = [ + ('index', + 'OpenCAFE', + u'OpenCAFE Documentation', + u'Rackspace', + 'OpenCAFE', + 'One line description of project.', + 'Miscellaneous')] diff --git a/docs/source/contributing/standards.rst b/docs/source/contributing/standards.rst index 7c25753..70a683b 100644 --- a/docs/source/contributing/standards.rst +++ b/docs/source/contributing/standards.rst @@ -25,7 +25,7 @@ Rules of Law Development Standards ------------------- +--------------------- - It is **HIGHLY** encouraged that if you have not already read (and even if it's been a while since you have) the Python Enhancement Proposals (PEPs) PEP-8 and PEP 20 that you do so. @@ -50,10 +50,12 @@ Development Standards on the open parenthesis of a function call. - Long strings should be handled by wrapping the string in parenthesis and having quote delimited strings per line within. + Example:: long_string = ('I cannot fit this whole phrase on one ' 'line, but I can properly format this string ' 'by using this type of structure.') + - Do not write "except:", use "except Exception:" at the very least - Use try/except where logical. Avoid wrapping large blocks of code in in huge try/except blocks. diff --git a/docs/source/index.rst b/docs/source/index.rst index 2cc9c03..a325760 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -28,6 +28,7 @@ Contents .. toctree:: :maxdepth: 2 + cafe/index getting_started/index contributing/index architecture/index diff --git a/plugins/http/cafe/engine/clients/rest.py b/plugins/http/cafe/engine/clients/rest.py index 6ef92fe..50e2bb0 100644 --- a/plugins/http/cafe/engine/clients/rest.py +++ b/plugins/http/cafe/engine/clients/rest.py @@ -12,9 +12,6 @@ # under the License. from warnings import warn, simplefilter -simplefilter("default", DeprecationWarning) -warn("cafe.engine.clients.rest has been moved to cafe.engine.http.client", - DeprecationWarning) from cafe.engine.http.client import ( BaseClient, requests, time, _inject_exception, _log_transaction, cclogging) @@ -25,3 +22,7 @@ from cafe.engine.http.client import \ AutoMarshallingHTTPClient as AutoMarshallingRestClient from cafe.engine.http.client import HTTPClient as RestClient + +simplefilter("default", DeprecationWarning) +warn("cafe.engine.clients.rest has been moved to cafe.engine.http.client", + DeprecationWarning)