##### SUMMARY

Add integration tests for the csvfile lookup plugin.

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

csvfile lookup plugin

"""
    A CSV reader which will iterate over lines in the CSV file "f",
    which is encoded in the given encoding.
    """
    def __init__(self, f, dialect=csv.excel, encoding='utf-8', **kwds):
        if PY2:
            f = CSVRecoder(f, encoding)
        else:
            f = codecs.getreader(encoding)(f)
        self.reader = csv.reader(f, dialect=dialect, **kwds)
    def __next__(self):
        row = next(self.reader)
        return [to_text(s) for s in row]
    next = __next__  
    def __iter__(self):
        return self
class LookupModule(LookupBase):
    def read_csv(self, filename, key, delimiter, encoding='utf-8', dflt=None, col=1):
        try:
            f = open(filename, 'rb')
            creader = CSVReader(f, delimiter=to_native(delimiter), encoding=encoding)
            for row in creader:
                if len(row) and row[0] == key:
                    return row[int(col)]
        except Exception as e:
            raise AnsibleError("csvfile: %s" % to_native(e))
        return dflt
    def run(self, terms, variables=None, **kwargs):
        ret = []
        for term in terms: