コード例 #1
0
ファイル: PySQLiteStorageTest.py プロジェクト: souca/sixthdev
class PySQLiteStorageTest(MockStorageTest):
    def setUp(self):
        self.s = PySQLiteStorage(dbc)
        cur = dbc.cursor()
        try:
            cur.execute("DELETE FROM test_person")
        except:
            cur.execute("""
                CREATE TABLE test_person (
                    ID int primary key,
                    name varchar(32)
                )
                """)

    def check_store_quotes(self):
        self.populate()
        row = self.s.fetch("test_person", 1)
        row["name"] = "j'mo\"cha's'ha''ha"
        self.s.store("test_person", **row)
        assert self.wholedb() == [{
            "ID": 1,
            "name": "j'mo\"cha's'ha''ha"
        }, {
            "ID": 2,
            "name": "wanda"
        }]
コード例 #2
0
ファイル: PySQLiteStorageTest.py プロジェクト: souca/sixthdev
 def setUp(self):
     self.s = PySQLiteStorage(dbc)
     cur = dbc.cursor()
     try:
         cur.execute("DELETE FROM test_person")
     except:
         cur.execute("""
             CREATE TABLE test_person (
                 ID int primary key,
                 name varchar(32)
             )
             """)
コード例 #3
0
 def setUp(self):
     self.s = PySQLiteStorage(dbc)
     cur = dbc.cursor()
     try:
         cur.execute("DELETE FROM test_person")
     except:
         cur.execute(
             """
             CREATE TABLE test_person (
                 ID int primary key,
                 name varchar(32)
             )
             """)
コード例 #4
0
class PySQLiteStorageTest(MockStorageTest):

    def setUp(self):
        self.s = PySQLiteStorage(dbc)
        cur = dbc.cursor()
        try:
            cur.execute("DELETE FROM test_person")
        except:
            cur.execute(
                """
                CREATE TABLE test_person (
                    ID int primary key,
                    name varchar(32)
                )
                """)


    def check_store_quotes(self):
        self.populate()
        row = self.s.fetch("test_person", 1)
        row["name"] = "j'mo\"cha's'ha''ha"
        self.s.store("test_person", **row)
        assert self.wholedb() == [{"ID":1, "name":"j'mo\"cha's'ha''ha"},
                                  {"ID":2, "name":"wanda"}]