~lifeless/storm/bug-620615

« back to all changes in this revision

Viewing changes to tests/store/sqlite.py

  • Committer: Gustavo Niemeyer
  • Date: 2006-05-25 20:05:42 UTC
  • Revision ID: gustavo@niemeyer.net-20060525200541-c171f5100ab0a30f
- Implemented MySQL database support! Store tests all pass!
- Splitted out the store tests into per-database files.
- Implemented DateTime, Date, and Time kinds, and support for
  all backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from storm.databases.sqlite import SQLite
 
2
 
 
3
from tests.store.base import StoreTest
 
4
from tests.helper import TestHelper, MakePath
 
5
 
 
6
 
 
7
class SQLiteStoreTest(TestHelper, StoreTest):
 
8
 
 
9
    helpers = [MakePath]
 
10
 
 
11
    def setUp(self):
 
12
        TestHelper.setUp(self)
 
13
        StoreTest.setUp(self)
 
14
 
 
15
    def tearDown(self):
 
16
        TestHelper.tearDown(self)
 
17
        StoreTest.tearDown(self)
 
18
 
 
19
    def create_database(self):
 
20
        self.database = SQLite(self.make_path())
 
21
 
 
22
    def create_tables(self):
 
23
        connection = self.database.connect()
 
24
        connection.execute("CREATE TABLE test "
 
25
                           "(id INTEGER PRIMARY KEY,"
 
26
                           " title VARCHAR DEFAULT 'Default Title')")
 
27
        connection.execute("CREATE TABLE other "
 
28
                           "(id INTEGER PRIMARY KEY,"
 
29
                           " test_id INTEGER,"
 
30
                           " other_title VARCHAR)")
 
31
        connection.commit()
 
32
 
 
33
    def drop_tables(self):
 
34
        pass