cinder/cinder/tests/unit/volume/drivers
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
..
dell_emc Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
disco Remove usage of CONF from DISCO driver 2017-06-08 13:05:12 +02:00
fusionstorage FusionStorage: use versioned objects 2017-06-12 07:15:11 +00:00
hitachi Move driver options to "backend_defaults" section 2017-07-03 16:42:03 +02:00
hpe Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
huawei Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
ibm Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
infortrend Fix python 3.6 escape char warnings in strings 2017-07-11 17:04:54 -04:00
nec Tests: Don't write files to /tmp/nec/ 2017-09-06 11:15:31 -04:00
netapp Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
nexenta Move driver options to "backend_defaults" section 2017-07-03 16:42:03 +02:00
solidfire SolidFire Generic Groups Support 2017-05-24 10:13:53 -06:00
synology Removed unnecessary tearDown() methods 2017-08-24 14:46:56 +02:00
violin Remove unnecessary setUp and tearDown 2016-09-20 11:45:04 +08:00
vmware Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
__init__.py
test_blockbridge.py Tests: Fix Blockbridge hash randomization failure 2017-05-19 14:02:43 +00:00
test_coho.py RemoteFS: pass volume object to '_find_share' 2017-05-25 11:46:11 +03:00
test_coprhd.py Added CG capability to volume group in CoprHD 2017-07-19 17:49:59 +05:30
test_datera.py Datera 2.4.0 driver update 2017-06-30 14:33:49 -05:00
test_dothill.py Convert lenovo driver to use distributed lock manager 2017-07-20 23:13:20 -04:00
test_drbdmanagedrv.py Remove unnecessary setUp and tearDown 2016-09-20 11:45:04 +08:00
test_falconstor_fss.py Extend Falconstor driver to utilize multiple FSS storage pools 2017-05-24 10:26:53 +08:00
test_fujitsu.py Fujitsu Driver: Fix exception in terminate_connection with no connector 2017-08-04 14:35:34 +08:00
test_gpfs.py Move driver options to "backend_defaults" section 2017-07-03 16:42:03 +02:00
test_hgst.py Replace assertDictMatch with assertDictEqual method in tests 2016-12-21 12:06:24 -05:00
test_infinidat.py INFINIDAT: support for volume compression 2017-07-13 16:53:00 +03:00
test_kaminario.py Tiramisu: Add groups param to failover_host 2017-07-10 09:30:13 -07:00
test_lvm_driver.py Cloning a volume from a snapshot in thin lv 2017-08-01 09:34:28 +08:00
test_nfs.py RemoteFS: pass volume object to '_find_share' 2017-05-25 11:46:11 +03:00
test_nimble.py Removed unnecessary tearDown() methods 2017-08-24 14:46:56 +02:00
test_prophetstor_dpl.py Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
test_pure.py Create custom assertTrue and assertFalse 2017-09-11 18:31:20 +02:00
test_qnap.py Make QnapISCSIDriver unit tests faster 2017-03-14 13:56:44 +02:00
test_quobyte.py Merge "Move vol_db_empty to NFS driver" 2017-08-01 19:18:11 +00:00
test_rbd.py Merge "RBD: Fix stats reporting" 2017-09-06 01:09:02 +00:00
test_reduxio.py Move driver tests to tests/unit/volume/drivers 2017-01-19 19:46:24 +05:30
test_remotefs.py SMBFS: enhance volume cloning 2017-06-27 21:26:18 +00:00
test_san.py Move drivers unit tests to unit.volume.drivers directory 2016-07-25 17:39:50 -04:00
test_sheepdog.py Merge "Mock qemu calls in sheepdog tests" 2017-05-23 13:39:15 +00:00
test_tegile.py Fix for Tegile driver failing to establish volume connection 2016-10-03 17:57:08 -07:00
test_tintri.py Stop using mox in unit/volume/drivers/*.py 2016-09-01 22:19:39 +07:00
test_v7000_iscsi.py Move volume drivers unit tests to tests.unit.volume.driver module 2016-10-05 13:33:46 +03:00
test_veritas_cnfs.py Implementation of Cinder driver for Veritas Access 2017-05-21 10:13:20 +05:30
test_vrtshyperscale.py Implementation of cinder driver for Veritas HyperScale 2017-03-28 21:40:51 +05:30
test_vzstorage.py Merge "vzstorage: return from _create_cloned_volume" 2017-09-08 21:15:31 +00:00
test_xio.py Extracted HTTP response codes to constants 2017-03-22 12:05:18 +05:30
test_zadara.py Zadara driver - move from httplib to requests 2017-02-20 12:24:54 +00:00
test_zfssa.py Removed unnecessary tearDown() methods 2017-08-24 14:46:56 +02:00
test_zte_ks.py Move volume drivers unit tests to tests.unit.volume.driver module 2016-10-05 13:33:46 +03:00