@@ -124,8 +124,9 @@ def get_strings(self, count: int = 10, max_length: int = 10, random_length: bool
124
124
if count > 0 and max_length > 0 :
125
125
list_of_input_strings = self .__get_input_strings_from_string_type (string_type )
126
126
127
- # checking if user have specified any custom symbols, then the default symbols will be overridden
128
- list_of_input_strings = ['{}{}' .format (_temp_string , symbols ) if '@' in _temp_string else _temp_string for _temp_string in list_of_input_strings ]
127
+ if symbols :
128
+ # checking if user have specified any custom symbols, then the default symbols will be overridden
129
+ list_of_input_strings = [symbols if '@' in entry else entry for entry in list_of_input_strings ]
129
130
130
131
input_characters = list_of_input_strings if must_include_all_type else '' .join (list_of_input_strings )
131
132
list_of_strings = self .__get_strings (count , max_length , random_length , input_characters )
@@ -184,7 +185,7 @@ def __validate_input(self, count: int, max_length: int, random_length: bool, str
184
185
if symbols and not isinstance (symbols , str ):
185
186
raise UnsupportedTypeException ('symbols' , f'symbols should be either None or of string type instead of current { type (symbols )} type' )
186
187
187
- if symbols and not re .match ('[{}]' .format ({ StringType .SYMBOLS .value } ), symbols ):
188
+ if symbols and not re .match ('[{}]' .format (StringType .SYMBOLS .value ), symbols ):
188
189
raise InvalidInputSymbolsException (symbols )
189
190
190
191
def __get_input_strings_from_string_type (self , string_type : StringType ) -> list :
0 commit comments