def test_tsv_handler():
    data = "a\tb\tc\n1\t2\t3\n4\t5\t6"
    csv_file = cStringIO.StringIO(data)
    handler = CSVHandler(csv_file)
    test_run = handler.run()
    result = test_run.next()
    print result
    assert result['a'] == '1'
    assert result['b'] == '2'
    assert result['c'] == '3'
    result = test_run.next()
    assert result['a'] == '4'
    assert result['b'] == '5'
    assert result['c'] == '6'
def test_csv_handler():
    data = "a,b,c\n1,2,3\n4,5,6"
    csv_file = cStringIO.StringIO(data)
    handler = CSVHandler(csv_file)
    test_run = handler.run()
    result = test_run.next()
    print result
    assert result['a'] == '1'
    assert result['b'] == '2'
    assert result['c'] == '3'
    result = test_run.next()
    assert result['a'] == '4'
    assert result['b'] == '5'
    assert result['c'] == '6'