@@ -58,8 +58,8 @@ def check_type(
58
58
error_message = (
59
59
"We were expecting to receive a list of objects of the "
60
60
"following types: "
61
- f"{ ", " .join ([repr (t .__name__ ) for t in acceptable_types ])} "
62
- f"{ " or 'None'" if optional else "" } ; instead we received "
61
+ f"{ ', ' .join ([repr (t .__name__ ) for t in acceptable_types ])} "
62
+ f"{ ' or \ ' None\' ' if optional else '' } ; instead we received "
63
63
f"{ obj } which is a { repr (type (obj ).__name__ )} ."
64
64
)
65
65
raise TypeError (error_message )
@@ -69,8 +69,8 @@ def check_type(
69
69
error_message = (
70
70
"We were expecting to receive an object of one of the "
71
71
"following types: "
72
- f"{ ", " .join (repr (t .__name__ ) for t in acceptable_types )} "
73
- f"{ " or 'None'" if optional else "" } ; instead we "
72
+ f"{ ', ' .join (repr (t .__name__ ) for t in acceptable_types )} "
73
+ f"{ ' or \ ' None\' ' if optional else '' } ; instead we "
74
74
f"received { o } which is a { repr (type (o ).__name__ )} ."
75
75
)
76
76
raise TypeError (error_message )
@@ -81,8 +81,8 @@ def check_type(
81
81
else :
82
82
error_message = (
83
83
"We were expecting to receive an instance of one of the following "
84
- f"types: { ", " .join (repr (t .__name__ ) for t in acceptable_types )} "
85
- f"{ " or 'None'" if optional else "" } ; but instead we received "
84
+ f"types: { ', ' .join (repr (t .__name__ ) for t in acceptable_types )} "
85
+ f"{ ' or \ ' None\' ' if optional else '' } ; but instead we received "
86
86
f"{ obj } which is a { repr (type (obj ).__name__ )} ."
87
87
)
88
88
@@ -140,7 +140,7 @@ def validate_input(
140
140
# Check if the value is in the tuple of allowed values
141
141
if value_to_check not in allowed_values :
142
142
raise ValueError (
143
- f"Invalid value: \" { input_value } \" . "
143
+ f"Invalid value: ' { input_value } ' . "
144
144
f"Must be one of { expected_values } ."
145
145
)
146
146
@@ -172,20 +172,20 @@ def validate_dict_str(
172
172
return
173
173
174
174
if not isinstance (input_value , dict ):
175
- raise TypeError (f"\" { input_value } \" is not of type \" dict\" " )
175
+ raise TypeError (f"' { input_value } ' is not of type ' dict' " )
176
176
177
177
errors = []
178
178
179
179
for key , value in input_value .items ():
180
180
if not isinstance (key , key_type ):
181
181
errors .append (
182
- f"Key \" { key } \" of type \" { type (key ).__name__ } \" "
183
- f"is not of type \" { key_type .__name__ } \" ."
182
+ f"Key ' { key } ' of type ' { type (key ).__name__ } ' "
183
+ f"is not of type ' { key_type .__name__ } ' ."
184
184
)
185
185
if not isinstance (value , value_type ):
186
186
errors .append (
187
- f"Value \" { value } \" of type \" { type (value ).__name__ } \" "
188
- f"is not of type \" { value_type .__name__ } \" ."
187
+ f"Value ' { value } ' of type ' { type (value ).__name__ } ' "
188
+ f"is not of type ' { value_type .__name__ } ' ."
189
189
)
190
190
191
191
if errors :
@@ -219,7 +219,7 @@ def validate_uri(
219
219
return
220
220
221
221
if not isinstance (uri , str ):
222
- raise TypeError (f"\" { uri } \" is not of type \" str\" " )
222
+ raise TypeError (f"' { uri } ' is not of type ' str' " )
223
223
224
224
# First validate using urlparse
225
225
parsed_uri = urlparse (uri )
0 commit comments