Skip to content

Commit

Permalink
added count to tupleit (refs #444)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Aug 29, 2016
1 parent 235dd60 commit a783293
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions framework/fuzzer/dictio.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ def next(self):

return item

class tupleit(itertools.imap):
class tupleit:
def __init__(self, parent):
self.parent = parent

def count(self):
return -1
return self.parent.count()

def next(self):
return (self.parent.next(),)

class dictionary:
def __init__(self, payload, encoders_list):
Expand Down Expand Up @@ -86,7 +92,7 @@ def _init_dictio(self, payload_options):
selected_dic.append(sliceit(pp, slicestr) if slicestr else pp)

if len(selected_dic) == 1:
return tupleit(lambda x: (x,), selected_dic[0])
return tupleit(selected_dic[0])
elif payload_options["iterator"]:
return Facade().get_iterator(payload_options["iterator"])(*selected_dic)
else:
Expand Down

0 comments on commit a783293

Please sign in to comment.