def fake_os_walk(paths):
 paths_dict = dict(paths)
 def os_walk(top, topdown=True):
  (dirs, nondirs) = paths_dict[top]
  (yield (top, dirs, nondirs))
  for name in dirs:
   new_path = '/'.join([top, name])
   for x in os_walk(new_path, topdown):
    (yield x)
 return os_walk

def fake_os_walk ( paths ) : paths_dict = dict ( paths ) def os_walk ( top , topdown = True ) : ( dirs , nondirs ) = paths_dict [ top ] ( yield ( top , dirs , nondirs ) ) for name in dirs : new_path = '/' . join ( [ top , name ] ) for x in os_walk ( new_path , topdown ) : ( yield x ) return os_walk
helper function for mocking os .