]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Targets test refactoring
authorAnton Arefiev <aarefiev@mirantis.com>
Thu, 30 Apr 2015 13:54:23 +0000 (16:54 +0300)
committerAnton Arefiev <aarefiev@mirantis.com>
Thu, 30 Apr 2015 15:02:57 +0000 (18:02 +0300)
commitbdd0ff6c685855a47034cdfa0cdfa50a4d153a1d
tree2f3147acc1953adba9c4308629c2a0c1629a3af7
parent6b0ef349b4e54da70cad1d67d9c1e2dabf95a460
Targets test refactoring

The unit tests for iser inherit from the tgtAdm, it means that any
time run tests for iser, tgtAdm tests run too. This chache add
TargetFixture to tests, it allows to decouple tests and delete
duplicated code.

Other changes:
 -  deleted  __init__ in test's classes; __init__ may work as a
replacement for setUp, but  setUp should be used instead because
it is part of the protocol for writing tests. It also has a
counterpart, tearDown, which __init__ does no;
 - replaced stubs to mock.

Change-Id: I8aa9f756efb0b4fc4a3a0ea960c6f2d8e20ec18a
Closes-Bug: #1420009
cinder/tests/unit/targets/targets_fixture.py [new file with mode: 0644]
cinder/tests/unit/targets/test_base_iscsi_driver.py
cinder/tests/unit/targets/test_cxt_driver.py
cinder/tests/unit/targets/test_iet_driver.py
cinder/tests/unit/targets/test_iser_driver.py
cinder/tests/unit/targets/test_lio_driver.py
cinder/tests/unit/targets/test_scst_driver.py
cinder/tests/unit/targets/test_tgt_driver.py