File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -161,12 +161,13 @@ def parse_random_text_generator(configuration):
161
161
"Illegal character set name, is not defined: {0}" .format (character_set ))
162
162
characters = CHARACTER_SETS [character_set ]
163
163
else : # Custom characters listing, not a character set
164
- characters = str ( configuration .get ('characters' ) )
164
+ characters = configuration .get ('characters' )
165
165
166
166
min_length = int (configuration .get ('min_length' , 8 ))
167
167
max_length = int (configuration .get ('max_length' , 8 ))
168
168
if not characters :
169
169
return factory_generate_text (min_length = min_length , max_length = max_length )()
170
+ characters = str (characters )
170
171
171
172
if configuration .get ('length' ):
172
173
length = int (configuration .get ('length' ))
Original file line number Diff line number Diff line change @@ -205,6 +205,11 @@ def test_parse_text_generator(self):
205
205
"Should never parse an invalid character_set successfully, but did!" )
206
206
except ValueError :
207
207
pass
208
+ test_config = {'type' : 'random_text' }
209
+ try :
210
+ gen = generators .parse_generator (test_config )
211
+ except Exception :
212
+ self .fail ("Should never Raise an exception!" )
208
213
209
214
# Test for character set handling
210
215
for charset in generators .CHARACTER_SETS :
You can’t perform that action at this time.
0 commit comments