File: test_mysql_ado.py

package info (click to toggle)
python-jtoolkit 0.7.8-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,436 kB
  • ctags: 2,536
  • sloc: python: 15,143; makefile: 20
file content (35 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python

from jToolkit.test import base_test_database

class TestMySQLADO(base_test_database.BaseTestDatabase):
    """Tests MySQL ADO (using the MySqlProv driver)"""
    def setup_class(cls):
        # Requires MySQL to be set up with a user "mytest", no password, with privileges on a database "mytest"
        class Config:
            pass
        config = Config()
        config.DBNAME = "mytest"
        config.DBHOST = None
        config.DBUSER = "mytest"
        config.DBPASSWORD = ""
        config.DBPROVIDER = "MySqlProv"
        config.DBTYPE = "mysql"
        base_test_database.BaseTestDatabase.create_database(config)

class TestMySQLADOWithHost(base_test_database.BaseTestDatabase):
    """Tests MySQL ADO (using the MySqlProv driver) with DBHOST defined.  This is broken at the moment"""
    def setup_class(cls):
        # Requires MySQL to be set up with a user "mytest", no password, with privileges on a database "mytest"
        class Config:
            pass
        config = Config()
        config.DBNAME = "mytest"
        config.DBHOST = "localhost"
        config.DBUSER = "mytest"
        config.DBPASSWORD = ""
        config.DBPROVIDER = "MySqlProv"
        config.DBTYPE = "mysql"
        base_test_database.BaseTestDatabase.create_database(config)

# At some point, we should also have a network test