File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -213,8 +213,18 @@ def endswith_version(string):
213
213
return False
214
214
215
215
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
218
228
219
229
220
230
def load_json_dict (json_body ):
@@ -224,7 +234,7 @@ def load_json_dict(json_body):
224
234
:param json_body: the json body of a request might be string, unicode or dict
225
235
:return: the json body as a dictionary
226
236
"""
227
- if isinstance (json_body , str ) or isinstance ( json_body , unicode ):
237
+ if isinstance (json_body , six . text_type ):
228
238
json_body = json .loads (json_body )
229
239
if isinstance (json_body , dict ):
230
240
return json_body
Original file line number Diff line number Diff line change 9
9
BARBICAN_CONFIG_PATH = WORKDIR + '/fixtures/barbican.yaml'
10
10
11
11
12
- class TestIronic (unittest .TestCase ):
12
+ class TestBarbican (unittest .TestCase ):
13
13
is_setup = False
14
14
15
15
def setUp (self ):
You can’t perform that action at this time.
0 commit comments