diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2010-10-09 18:03:05 +0200 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2010-10-09 18:03:05 +0200 |
| commit | 7265e6df7e7ae830964d7a39b9ec6e84de41e54b (patch) | |
| tree | f65ba04c77fe59b3a03472cb85edb212204af289 | |
| parent | e046bb92df0ea62cc36626491edbf04811894392 (diff) | |
added dbutils tests
| -rw-r--r-- | dbutils.py | 5 | ||||
| -rw-r--r-- | dbutils_test.py | 15 |
2 files changed, 18 insertions, 2 deletions
@@ -1,10 +1,11 @@ import cx_Oracle import dbconfig -connStr = '%s/%s@%s' % (dbconfig.USER, dbconfig.PASS, dbconfig.SID) +CONN_STR = '%s/%s@%s' % (dbconfig.USER, dbconfig.PASS, dbconfig.SID) def get_tables(): - with cx_Oracle.connect(connStr) as conn: + with cx_Oracle.connect(CONN_STR) as conn: cur = conn.cursor() cur.execute('SELECT owner, table_name FROM all_tables') return [table for owner, table in cur.fetchall()] + diff --git a/dbutils_test.py b/dbutils_test.py new file mode 100644 index 0000000..ba4d6bb --- /dev/null +++ b/dbutils_test.py @@ -0,0 +1,15 @@ +import unittest + +import dbutils + +class DBUtilsTest(unittest.TestCase): + + def setUp(self): + self.seq = range(10) + + def test_get_tables(self): + tables = dbutils.get_tables() + self.assertTrue(len(tables) >= 1) + +if __name__ == '__main__': + unittest.main() |
