+ output.seek(0)
+ sheet = list(csv.DictReader(output))
+ expected = [{'SampleProject': '12044_index1',
+ 'Index': 'ATCACG',
+ 'Lane': '3',
+ },
+ {'SampleProject': '12044_index2',
+ 'Index': 'CGATGT',
+ 'Lane': '3',
+ },
+ {'SampleProject': '12044_index3',
+ 'Index': 'TTAGGC',
+ 'Lane': '3',
+ },
+ {'SampleProject': '11045_index1',
+ 'Index': 'ATCACG',
+ 'Lane': '3',
+ },
+ {'SampleProject': '13044_indexN701-N501',
+ 'Index': 'TAAGGCGA-TAGATCGC',
+ 'Lane': '4',
+ }
+ ]
+ self.failUnlessEqual(len(sheet), len(expected))
+ for s, e in zip(sheet, expected):
+ for key in e.keys():
+ self.failUnlessEqual(s[key], e[key],
+ "%s != %s for key %s" % (s[key],e[key], key))