|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +from __future__ import print_function |
| 4 | + |
| 5 | +import sys |
| 6 | +import unittest |
| 7 | + |
| 8 | +import dbapi20 |
| 9 | + |
| 10 | +import tarantool |
| 11 | +from tarantool.dbapi import Connection |
| 12 | +from .lib.tarantool_server import TarantoolServer |
| 13 | + |
| 14 | + |
| 15 | +class TestSuite_DBAPI(dbapi20.DatabaseAPI20Test): |
| 16 | + table_prefix = 'dbapi20test_' # If you need to specify a prefix for tables |
| 17 | + |
| 18 | + ddl1 = 'create table %sbooze (name varchar(20) primary key)' % table_prefix |
| 19 | + ddl2 = 'create table %sbarflys (name varchar(20) primary key, ' \ |
| 20 | + 'drink varchar(30))' % table_prefix |
| 21 | + |
| 22 | + @classmethod |
| 23 | + def setUpClass(self): |
| 24 | + print(' DBAPI '.center(70, '='), file=sys.stderr) |
| 25 | + print('-' * 70, file=sys.stderr) |
| 26 | + self.srv = TarantoolServer() |
| 27 | + self.srv.script = 'unit/suites/box.lua' |
| 28 | + self.srv.start() |
| 29 | + self.con = tarantool.Connection(self.srv.host, self.srv.args['primary']) |
| 30 | + self.driver = Connection(self.srv.host, self.srv.args['primary']) |
| 31 | + |
| 32 | + def setUp(self): |
| 33 | + # prevent a remote tarantool from clean our session |
| 34 | + if self.srv.is_started(): |
| 35 | + self.srv.touch_lock() |
| 36 | + self.con.flush_schema() |
| 37 | + |
| 38 | + # grant full access to guest |
| 39 | + self.srv.admin("box.schema.user.grant('guest', 'create,read,write," |
| 40 | + "execute', 'universe')") |
| 41 | + |
| 42 | + @classmethod |
| 43 | + def tearDownClass(self): |
| 44 | + self.con.close() |
| 45 | + self.srv.stop() |
| 46 | + self.srv.clean() |
| 47 | + |
| 48 | + @unittest.skip('Not implemented') |
| 49 | + def test_Binary(self): |
| 50 | + pass |
| 51 | + |
| 52 | + @unittest.skip('Not implemented') |
| 53 | + def test_STRING(self): |
| 54 | + pass |
| 55 | + |
| 56 | + @unittest.skip('Not implemented') |
| 57 | + def test_BINARY(self): |
| 58 | + pass |
| 59 | + |
| 60 | + @unittest.skip('Not implemented') |
| 61 | + def test_NUMBER(self): |
| 62 | + pass |
| 63 | + |
| 64 | + @unittest.skip('Not implemented') |
| 65 | + def test_DATETIME(self): |
| 66 | + pass |
| 67 | + |
| 68 | + @unittest.skip('Not implemented') |
| 69 | + def test_ROWID(self): |
| 70 | + pass |
| 71 | + |
| 72 | + @unittest.skip('Not implemented') |
| 73 | + def test_Date(self): |
| 74 | + pass |
| 75 | + |
| 76 | + @unittest.skip('Not implemented') |
| 77 | + def test_Time(self): |
| 78 | + pass |
| 79 | + |
| 80 | + @unittest.skip('Not implemented') |
| 81 | + def test_Timestamp(self): |
| 82 | + pass |
| 83 | + |
| 84 | + @unittest.skip('Not implemented as optional.') |
| 85 | + def test_nextset(self): |
| 86 | + pass |
| 87 | + |
| 88 | + @unittest.skip('To do') |
| 89 | + def test_callproc(self): |
| 90 | + pass |
| 91 | + |
| 92 | + def test_setoutputsize(self): # Do nothing |
| 93 | + pass |
| 94 | + |
| 95 | + @unittest.skip('To do') |
| 96 | + def test_description(self): |
| 97 | + pass |
0 commit comments