summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd/test_add_brick.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-11-22 22:02:02 +0530
committerValerii Ponomarov <vponomar@redhat.com>2019-11-28 17:48:26 +0530
commit7478c9fafaebeab1054509fc92b2767d80c60c4d (patch)
treed03f5be9d58daf62408bf0ffb849c0eee89592af /tests/functional/glusterd/test_add_brick.py
parent2d04a06998a4c114a8aa22cb7cd2d58d9788ec43 (diff)
[py2to3] Refactor gluster_base_class.py
Following changes were implemented: - Delete unused imports and place used ones in the alphabetical order. Imports are splitted into 3 groups: built-ins, third-parties and local modules/libs. - Make changes to support py3 in addition to py2. - Minimize number of code lines keeping the same behaviour and improving readability. - Add possibility to get 'bound' (cls) methods using 'get_super_method' staticmethod from base class. Before it was possible to call only unbound (self) methods. - Update 'test_add_brick.py' module as PoC for running base class bound methods in both - py2 and py3. Now this module py2/3 compatible. Change-Id: I1b66b3a91084b2487c26bec8763ab2b4e12ac482 Signed-off-by: Valerii Ponomarov <kiparis.kh@gmail.com>
Diffstat (limited to 'tests/functional/glusterd/test_add_brick.py')
-rw-r--r--tests/functional/glusterd/test_add_brick.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/functional/glusterd/test_add_brick.py b/tests/functional/glusterd/test_add_brick.py
index c802c79be..b8646098d 100644
--- a/tests/functional/glusterd/test_add_brick.py
+++ b/tests/functional/glusterd/test_add_brick.py
@@ -33,7 +33,7 @@ class TestVolumeCreate(GlusterBaseClass):
def setUpClass(cls):
# Calling GlusterBaseClass setUpClass
- GlusterBaseClass.setUpClass.im_func(cls)
+ cls.get_super_method(cls, 'setUpClass')()
# check whether peers are in connected state
if not cls.validate_peers_are_connected():
@@ -57,7 +57,7 @@ class TestVolumeCreate(GlusterBaseClass):
raise ExecutionError("Failed to delete the brick dirs.")
g.log.info("Successfully cleaned all the brick dirs.")
- GlusterBaseClass.tearDown.im_func(self)
+ self.get_super_method(self, 'tearDown')()
def test_add_brick_functionality(self):