This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via a5531c8d0b499b82ed714aa4971b14b41ae7610c (commit)
from 2a85338c232bda8c4c0ecb50266491c5a04d414c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/a5531c8d0b499b82ed714aa4971b14b41ae7610c
commit a5531c8d0b499b82ed714aa4971b14b41ae7610c
Author: Oleg Broytman <ph...@ph...>
Date: Thu Jun 29 01:09:54 2017 +0300
Add test_csvimport.py
diff --git a/docs/News.rst b/docs/News.rst
index 3810aa8..e2a430c 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -38,6 +38,9 @@ Tests
* Use remove-old-files.py from ppu to cleanup pip cache
at Travis and AppVeyor.
+* Add test_csvimport.py more as an example how to use load_csv
+ from sqlobject.util.csvimport.
+
SQLObject 3.3.0
===============
diff --git a/sqlobject/tests/test_csvimport.py b/sqlobject/tests/test_csvimport.py
new file mode 100644
index 0000000..990f450
--- /dev/null
+++ b/sqlobject/tests/test_csvimport.py
@@ -0,0 +1,21 @@
+import csv
+from datetime import datetime
+from sqlobject.util.csvimport import load_csv
+
+csv_data = """\
+name:str,age:datetime,value:int
+Test,2000-01-01 21:44:33,42"""
+
+
+def test_load_csv():
+ loaded = load_csv(csv.reader(csv_data.split('\n')),
+ default_class='SQLObject')
+ assert loaded == {
+ 'SQLObject': [
+ {
+ 'age': datetime(2000, 1, 1, 21, 44, 33),
+ 'name': 'Test',
+ 'value': 42
+ }
+ ]
+ }
-----------------------------------------------------------------------
Summary of changes:
docs/News.rst | 3 +++
sqlobject/tests/test_csvimport.py | 21 +++++++++++++++++++++
2 files changed, 24 insertions(+)
create mode 100644 sqlobject/tests/test_csvimport.py
hooks/post-receive
--
SQLObject development repository
|