cinder/cinder/tests/unit/volume/drivers/netapp/dataontap
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
..
client Enable some off-by-default checks 2017-06-22 02:17:54 +00:00
performance NetApp DOT: Fix hash randomization test failures 2017-05-25 15:58:59 -04:00
utils NetApp DOT: Fix hash randomization test failures 2017-05-25 15:58:59 -04:00
__init__.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
fakes.py NetApp: Fix override of scheduler decision 2017-08-08 20:49:35 -04:00
test_block_7mode.py NetApp cDOT: Support generic groups for block 2017-07-27 15:22:32 -04:00
test_block_base.py Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
test_block_cmode.py NetApp: Remove redundant QoS cleanup task 2017-09-06 17:56:16 -04:00
test_block_driver_interfaces.py NetApp cDOT: Support generic groups for block 2017-07-27 15:22:32 -04:00
test_nfs_7mode.py NetApp cDOT: Support generic groups for file 2017-07-24 20:16:57 -04:00
test_nfs_base.py NetApp: Fix override of scheduler decision 2017-08-08 20:49:35 -04:00
test_nfs_cmode.py NetApp: Remove redundant QoS cleanup task 2017-09-06 17:56:16 -04:00