@@ -0,0 +1,1039 @@
+# encoding: utf-8%0A%0Afrom __future__ import print_function, unicode_literals%0A%0Aimport sys%0A%0Aimport pytest%0Afrom simplesqlite import connect_memdb%0Afrom simplesqlite.model import Blob, Integer, Model, Real, Text%0A%0A%0Aclass Hoge(Model):%0A    hoge_id = Integer()%0A    name = Text()%0A%0A%0Aclass Foo(Model):%0A    foo_id = Integer(not_null=True)%0A    name = Text(not_null=True)%0A    value = Real(not_null=True)%0A    blob = Blob()%0A%0A%0Adef test_orm():%0A    con = connect_memdb()%0A%0A    Hoge.attach(con, is_hidden=True)%0A    Hoge.create()%0A    hoge_inputs = %5BHoge(hoge_id=10, name=%22a%22), Hoge(hoge_id=20, name=%22b%22)%5D%0A    for hoge_input in hoge_inputs:%0A        Hoge.insert(hoge_input)%0A%0A    Foo.attach(con)%0A    Foo.create()%0A    foo_inputs = %5BFoo(foo_id=11, name=%22aq%22, value=0.1), Foo(foo_id=22, name=%22bb%22, value=1.11)%5D%0A    for foo_input in foo_inputs:%0A        Foo.insert(foo_input)%0A%0A    for record, hoge_input in zip(Hoge.select(), hoge_inputs):%0A        assert record == hoge_input%0A%0A    for record, foo_input in zip(Foo.select(), foo_inputs):%0A        assert record == foo_input%0A

Add a test case for ORM