summaryrefslogtreecommitdiffstats
path: root/tests/functional/glusterd
diff options
context:
space:
mode:
authorLeela Venkaiah G <lgangava@redhat.com>2020-07-23 15:30:41 +0530
committerBala Konda Reddy M <bala12352@gmail.com>2020-07-27 05:17:07 +0000
commit5727e6a8e11e894fce2bf7814a84077a4f95c5b0 (patch)
treed97da2cc60227f8524c91bb88662aecf5d26a2e8 /tests/functional/glusterd
parent21ea1866884bf538fd1a4bee5257c747cd5f41b1 (diff)
[TestFix] Replace `translate` with `replace`
- `replace` funciton to used to forgo version check - `unicode` is not being recognized from builtins in py2 - `replace` seems correct alternative than fixing unicode Change-Id: Ieb9b5ad283e1a31d65bd8a9715b80f9deb0c05fe Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
Diffstat (limited to 'tests/functional/glusterd')
-rw-r--r--tests/functional/glusterd/test_change_reserve_limit_to_wrong_values.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/functional/glusterd/test_change_reserve_limit_to_wrong_values.py b/tests/functional/glusterd/test_change_reserve_limit_to_wrong_values.py
index 93ea816ef..334639e7c 100644
--- a/tests/functional/glusterd/test_change_reserve_limit_to_wrong_values.py
+++ b/tests/functional/glusterd/test_change_reserve_limit_to_wrong_values.py
@@ -16,7 +16,6 @@
import string
from random import choice
-from sys import version_info
from glusto.core import Glusto as g
@@ -31,8 +30,6 @@ class TestChangeReserveLimit(GlusterBaseClass):
Test to validate behaviour of 'storage.reserve' option on supplying
erroneous values.
"""
-
- # pylint: disable=redefined-builtin
def setUp(self):
self.get_super_method(self, 'setUp')()
ret = self.setup_volume()
@@ -63,16 +60,12 @@ class TestChangeReserveLimit(GlusterBaseClass):
# Data has: alphabets, numbers, punctuations and their combinations
key = 'storage.reserve'
- # Make `unicode` compatible with py2/py3
- if version_info.major == 3:
- unicode = str
-
for char_type in (string.ascii_letters, string.punctuation,
string.printable):
# Remove quotes from the generated string
temp_val = self.get_random_string(char_type)
- temp_val = unicode(temp_val).translate({39: None, 35: None})
+ temp_val = temp_val.replace("'", "").replace("&", "")
value = "'{}'".format(temp_val)
ret = set_volume_options(self.mnode, self.volname, {key: value})
self.assertFalse(