From 18f5b5afeb2583b4a24d91920fb8a93f668c8c43 Mon Sep 17 00:00:00 2001 From: Christopher Sabater Cordero Date: Wed, 29 Mar 2017 22:47:02 -0400 Subject: [PATCH] updated test_load_with_chunking --- test_load_table.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test_load_table.py b/test_load_table.py index 624abd1..703867f 100644 --- a/test_load_table.py +++ b/test_load_table.py @@ -74,18 +74,32 @@ def test_load_with_chunking(self, tmpdir): Tom, 1980-02-26, 0 Dick, 1982-03-14, 3 Harry, 1972-11-24, 2 + Chris, 1991-08-03, 0 + Jill, 1990-04-15, 1 + Lorenzo, 2003-01-01, 0 + Alyssa, 2005-02-02, 1 + Andrew, 2008-03-03, 1 + Javi, 2008-04-04, 2 """ - self.load_table(tmpdir, CSV, 'people', chunksize=1) + self.load_table(tmpdir, CSV, 'people', chunksize=4) people = self.meta.tables['people'] connection = self.engine.connect() results = connection.execute( select([people]).order_by(people.c.index)).fetchall() + assert (0, 'Tom', '1980-02-26', '0') == results[0] assert (1, 'Dick', '1982-03-14', '3') == results[1] assert (2, 'Harry', '1972-11-24', '2') == results[2] + assert (3, 'Chris', '1991-08-03', '0') == results[3] + assert (4, 'Jill', '1990-04-15', '1') == results[4] + assert (5, 'Lorenzo', '2003-01-01', '0') == results[5] + assert (6, 'Alyssa', '2005-02-02', '1') == results[6] + assert (7, 'Andrew', '2008-03-03', '1') == results[7] + assert (8, 'Javi', '2008-04-04', '2') == results[8] + def test_empty_csv(self, tmpdir): file_name = 'empty.csv'