File: test_mysql.py

package info (click to toggle)
sqlobject 3.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,280 kB
  • ctags: 17,912
  • sloc: python: 16,713; sh: 18; makefile: 13
file content (22 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
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()