Skip to content

Commit e218531

Browse files
committed
fix test name
1 parent e9ffc19 commit e218531

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

watcher/common.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,18 @@ def endswith_version(string):
213213
return False
214214

215215

216-
def string_to_bool(bool_string):
217-
return bool_string.lower() == 'true'
216+
def string_to_bool(possible_bool_string):
217+
"""
218+
ensures a bool
219+
220+
:param possible_bool_string: might be string, unicode or bool
221+
:return: bool
222+
"""
223+
if isinstance(possible_bool_string, bool):
224+
return possible_bool_string
225+
if isinstance(possible_bool_string, six.text_type):
226+
return str(possible_bool_string).lower() == 'true'
227+
return False
218228

219229

220230
def load_json_dict(json_body):
@@ -224,7 +234,7 @@ def load_json_dict(json_body):
224234
:param json_body: the json body of a request might be string, unicode or dict
225235
:return: the json body as a dictionary
226236
"""
227-
if isinstance(json_body, str) or isinstance(json_body, unicode):
237+
if isinstance(json_body, six.text_type):
228238
json_body = json.loads(json_body)
229239
if isinstance(json_body, dict):
230240
return json_body

watcher/tests/test_barbican.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
BARBICAN_CONFIG_PATH = WORKDIR + '/fixtures/barbican.yaml'
1010

1111

12-
class TestIronic(unittest.TestCase):
12+
class TestBarbican(unittest.TestCase):
1313
is_setup = False
1414

1515
def setUp(self):

0 commit comments

Comments
 (0)