cinder/cinder/tests/unit/volume/drivers/ibm
Gorka Eguileor 720f07f0d6 Create custom assertTrue and assertFalse
Python's unittest framework assertTrue and assertFalse methods don't
check that the provided value is False or True, like the documentation
says:

  Note that this is equivalent to bool(expr) is True and not to expr is
  True (use assertIs(expr, True) for the latter).

According to the documentation we should try to avoid using it as much
as possible:

  This method should also be avoided when more specific methods are
  available (e.g.  assertEqual(a, b) instead of assertTrue(a == b)),
  because they provide a better error message in case of failure.

But in our current code we keep abusing its use in many ways, among
which we can easily find the following:

- Thinking it only matches False/True

- assertTrue(expected, actual) --> This will always be true as long as
bool(expected) is True, because actual is interpreted as the message to
return on failure.

- Incorrectly testing values, like checking for a tuple of the form
(True, {...}) instead of testing for True in the first position.

This patch fixes incorrect some of the incorrect uses of the methods and
overwrites default methods so that they behave the way many people think
they do:

- assertTrue(x) == assertIs(True,x)
- assertFalse(x) == assertIs(False,x)

This will hopefully help us prevent incorrect usage of the methods.

Change-Id: I1e8c82702932e6b6d940bd83d0a2d4494576a81b
2017-09-11 18:31:20 +02:00
..
__init__.py Move drivers unit tests to unit.volume.drivers directory 2016-07-25 17:39:50 -04:00
fake_pyxcli.py Ibm_storage - fix create volume into group. 2017-08-20 10:44:03 +03:00
fake_pyxcli_exceptions.py ignore error when remove non-exist vol from cg 2017-06-13 16:18:24 +03:00
test_ds8k_proxy.py DS8K: add replication consistency group support 2017-07-13 01:51:06 -07:00
test_ibm_flashsystem.py Revert "Using assertFalse(A) instead of assertEqual(False, A)" 2017-06-06 19:43:10 +00:00
test_ibm_flashsystem_iscsi.py Volume Manage/Unmanage Support for IBM FlashSystem 2016-08-17 09:01:54 -05:00
test_ibm_storage.py Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
test_storwize_svc.py Storwize: reduce duplicate validation 2017-08-28 09:25:58 +00:00
test_xiv_proxy.py Ibm_storage - fix create volume into group. 2017-08-20 10:44:03 +03:00