It is the first step to replace using tests.utils with openstack.common.test.
All these tests don't use mock objects, stubs, config files and use only
BaseTestCase class.
Change-Id: I511816b5c9e6c5c34ebff199296ee4fc8b84c672
bp: common-unit-tests
PEP 352 deprecated the message attribute of the BaseException class.
Using the message attribute will result in warnings like this:
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
Using unicode(exc) is the suggested replacement.
Change-Id: Ibf3c56e4baa6ad83e2b95a948787e9d02cf074d4
Python3 enforces the distinction between byte strings
far more rigorously than Python 2 does; binary data
cannot be automatically coerced to or from text data.
Use six to provide a fake file object for textual data.
It provides an alias for StringIO.StringIO in python2
and io.StringIO in python3
Change-Id: I65897bb0cca2cbeb5819a769b98645c9eb066401
Signed-off-by: Chuck Short <chuck.short@canonical.com>
This is another example of something which was imported from nova
but where nova was never moved across to use the oslo version. The
code has since diverged. This review syncs up the two versions,
and will be followed by a nova review to move nova across to the
oslo implementation.
Unit test coverage for this new version is 83%. I want to improve
that, but I'll do it in a later review.
I will also need to update cinder, quantum and nova to this new
version of the code once this merges. I will do moniker as well
because I am a nice guy.
Change-Id: Ie0731c56c9aab547b5d5b905bf4ed8eff3eae3bd
Using the BaseTestCase across the tests in the tree lets us put in log
fixtures and consistently handle mox and stubout.
Part of blueprint grizzly-testtools.
Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
On the path to testr migration, we need to replace the unittest base classes
with testtools.
Replace tearDown with addCleanup, addCleanup is more resilient than tearDown.
The fixtures library has excellent support for managing and cleaning
tempfiles. Use it.
Replace skip_ with testtools.skipTest
Part of blueprint grizzly-testtools.
Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98