Metadata-Version: 2.1
Name: sphinx_test_cases
Version: 0.5
Summary: This package is a simple extention to the Sphinx, which is
Home-page: https://github.com/ArtUrim/sphinx-test
Author: Arturim
Author-email: lozinski.artur@gmail.com
License: Apache
Keywords: sphinx test case scenario plan
Platform: UNKNOWN
Description-Content-Type: text/markdown
License-File: LICENSE

 <!-- headingDivider: 2 -->

# Auto description of tests

This package is a simple extention to the Sphinx, which is dedicated to
describe test cases. Includes also a directives to autogenerated from
the python function description

Allow to create description in *reStructuredText*, as well as
*docstring* attached to the **pytest** (currently only sole function,
which name begins with *test_*).

## Thanks

Based on the two examples from the
[sphinx](https://www.sphinx-doc.org/en/master/development/tutorials/index.html) documentation:
+ recipies
+ intenum

## Instalation

Standard instalation by *pip*:

> pip install sphinx_test_cases

## Source code

The source code is accessable on the **github** page (including two
sample usage):

`git clone https://github.com/ArtUrim/sphinx-test`

## Usage

There is one directive and several field

### Directive

`.. test:test:: *test_name*`

## Usage: fields

 - *suite* -- list (comma separated) of the test suite, to which the
 tests belongs
 - *reqs* -- list (comma separated) of the requirements covered by the
 test
 - *init* -- initial conditions (could be more then one). Shows in final
 doc as a enumerated list
 - *step* -- step to do/verify. In final doc, the enumerated list will
 covert to the enumerated list (same sequence as occured in the source
		 text file)
 - *pass* -- group of pass/fail execution criteria. In case of multiple
 occurence in the input file, each of them must be labelled

## Autodoc

Same as above. Autogenerated are
 - test name -- same as a name of the function, but initial `test_`
		 trunkated
 - suite -- autogenerated from the list of the `mark` decorators of the
 test function

## Indicies
 
There are three indicies generated
```
 * :ref:`test-requirement`
 * :ref:`test-test`
 * :ref:`test-suite`
```

Namely:
 - list of the requirements covered by at least one test cases (*reqs*
		field)
 - alphabetical list of the test cases
 - list of suites covered by any test cases (*suite* field)


The *requirements* and *suite* prresents list of the references to the
test cases which mentioned the *requirement* or *suite*.

## Example

The source code repository includes two simple example:
 - standalone -- the test description in the reStructuredText
 - docstring -- test case as a function repr

## containerization (*outdates*)

Preffered to use **python** *venv*

The examples could be executed using the docker container build by the `Dockerfile` from docker directory. On the docker hub, you can find the [image](https://hub.docker.com/repository/docker/arturim13/sphinx-testdec)

> docker pull arturim13/sphinx-testdec:01

### Build image

Execute in main repository directory (same as this README.md file)
> docker build -t arturim/sphinx-testdec -f docker/Dockerfile .


