

def test_dicts_to_csv(self):
    output_file = StringIO.StringIO()
    obj1 = {
        'a': 'v1',
        'b': 'v2',
    }
    obj2 = {
        'a': 'v"\'3',
        'b': 'v4',
    }
    obj3 = {
        'a': 'v5',
        'c': 'v6',
    }
    dicts_to_csv([obj1, obj2, obj3], output_file)
    result = self.getvalue().strip('\r\n')
    self.assertEquals('a,b,c\r\nv1,v2,\r\n"v""\'3",v4,\r\nv5,,v6', result)

dataset/ETHPy150Open vladikk/JSON2CSV/json2csv-tests.py JSON2CSVTests.test_dicts_to_csv/VarMisuse@81/128 `output_file`->`self`