Files
deb-nova/nova/tests/functional/api_sample_tests
EdLeafe a2d7ebd39b Corrects the type of a base64 encoded string
The nova/tests/functional/api_sample_tests/test_servers.py contains the
ServersSampleBase class, and in its class definition creates a
'user_data' attribute by base64 encoding a string. However, this will
not work in Python 3, as the base64.b64encode() method requires bytes,
not a string. As a result, importing the test class fails and no tests
get run.

Note that this change doesn't fix all tests to work under Python 3; it
simply fixes the bug that prevents the tests from running at all under
Python 3.

Closes-Bug: #1632856

Change-Id: I35a7b02132bed0387a173b339f6204bf0e3269de
2016-12-12 18:07:30 +00:00
..
2015-08-15 12:30:20 +10:00
2015-12-03 22:43:26 +00:00
2016-06-30 19:56:14 +00:00
2016-06-20 21:36:05 -04:00
2016-09-23 09:42:39 +00:00
2016-06-20 21:36:05 -04:00

Api Samples

This part of the tree contains templates for API samples. The documentation in doc/api_samples is completely autogenerated from the tests in this directory.

To add a new api sample, add tests for the common passing and failing cases in this directory for your extension, and modify test_samples.py for your tests.

Then run the following command:

tox -e api-samples

Which will create the files on doc/api_samples.

If new tests are added or the .tpl files are changed due to bug fixes, the samples must be regenerated so they are in sync with the templates, as there is an additional test which reloads the documentation and ensures that it's in sync.

Debugging sample generation

If a .tpl is changed, its matching .json must be removed else the samples won't be generated. If an entirely new extension is added, a directory for it must be created before its samples will be generated.