1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
import py.test
from sqlobject import SQLObject
from sqlobject.tests.dbtest import getConnection, setupClass
class TestSOListMySQL(SQLObject):
pass
def test_list_databases():
connection = getConnection()
if connection.dbName != "mysql":
py.test.skip("These tests require MySQL")
assert connection.db in connection.listDatabases()
def test_list_tables():
connection = getConnection()
if connection.dbName != "mysql":
py.test.skip("These tests require MySQL")
setupClass(TestSOListMySQL)
assert TestSOListMySQL.sqlmeta.table in connection.listTables()
|