7 Commits

Author SHA1 Message Date
Cyril Roelandt
928935e5c0 Do not use the six library in the tests.
Change-Id: Ic8a2a736a733e0151ca82f19bfde428dc04cf255
2020-06-15 21:04:56 +02:00
Ravi Jethani
610177a779 Add request id to returned objects
Adding two classes RequestIdProxy and GeneratorProxy derived from
wrapt.ObjectProxy to wrap objects returned from the API.

GeneratorProxy class is used to wrap generator objects returned
by cases like images.list() etc. whereas RequestIdProxy class is
used to wrap non-generator object cases like images.create() etc.

In all cases the returned object will have the same behavior as
the wrapped(original) object. However now the returned objects
will have an extra property 'request_ids' which is a list of
exactly one request id.

For generator cases the request_ids property will be an empty list
until the underlying generator is invoked at-least once.

Co-Authored-By: Abhishek Kekane <abhishek.kekane@nttdata.com>

Closes-Bug: #1525259
Blueprint: return-request-id-to-caller
Change-Id: If8c0e0843270ff718a37ca2697afeb8da22aa3b1
2017-01-20 14:50:42 +05:30
Stuart McLaren
7ed22a91d3 image-download: tests to catch stray output
Add unit tests to ensure that any stray output (eg print
statements) during image-download cause a test failure.

Regression test for bug 1488914.

Change-Id: Ic19ba5693d059bf7c283702e7c333672a878a1a1
Partial-bug: 1488914
2016-06-29 16:08:30 +00:00
Tin Lam
cd5925bc60 Enable hacking checks
Enabled following hacking checks from tox.ini:
- H233 Python 3.x incompatible use of print operator
- H303 no wildcard import
- H404 multi line docstring should start with a summary

Change-Id: I2553bcd3e80c00acc08d135a1d2dadfb6cda49fe
Partial-Bugs: #1475054
2016-04-18 16:23:59 +00:00
Darja Shakhray
ec0f2dfd85 Enable flake8 checks
This commit enables new flake8 checks:
* E265  block comment should start with '# '
* H405  multi line docstring summary not separated with an empty line
* E123  closing bracket does not match indentation of opening bracket's line
* H238  old style class declaration, use new style (inherit from `object`)
* E128  continuation line under-indented for visual indent
and makes related changes in the code.

Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
2015-07-21 17:08:27 +03:00
Cindy Pallares
997c12d3ab Import only modules and update tox.ini
As stated in the OpenStack Hacking Guidelines, it is prefered
that only modules should be imported.

Also updated tox.ini to ignore opestack/common among others.

Change-Id: I2f0a603c31052eadee581c11880c0ec6bd392829
2015-06-17 10:56:37 -05:00
Stuart McLaren
f2a8a520e7 Move unit tests to standard directory
This patch moves the glanceclient unit tests to the standard directory
(xxxclient/tests/unit) in preparation for adding functional gate tests
'check-glanceclient-dsvm-functional' in the same vein as existing client
tests for other projects, eg:

* check-novaclient-dsvm-functional
* check-keystoneclient-dsvm-functional
* check-neutronclient-dsvm-functional

Change-Id: I29d4b9e3a428c851575ee9afde40d6df583456c4
2015-04-18 17:42:20 +00:00