|
Revision 158
(checked in by fumanchu, 6 years ago)
|
New test for pythoncom in test_storemsaccess.py; warn if not importable.
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
"""This works...most of the time. Sometimes during the Multithreading, |
|---|
| 2 |
the Access SM will crash python.""" |
|---|
| 3 |
|
|---|
| 4 |
import warnings |
|---|
| 5 |
|
|---|
| 6 |
try: |
|---|
| 7 |
import pythoncom |
|---|
| 8 |
except ImportError: |
|---|
| 9 |
def run(): |
|---|
| 10 |
warnings.warn("The pythoncom module could not be imported. " |
|---|
| 11 |
"The MSAccess test will not be run.") |
|---|
| 12 |
else: |
|---|
| 13 |
from dejavu.storage import storeado |
|---|
| 14 |
mod = storeado.gen_py() |
|---|
| 15 |
if mod is None: |
|---|
| 16 |
def run(): |
|---|
| 17 |
warnings.warn("ADO 2.7 support could not be verified. " |
|---|
| 18 |
"The MSAccess test will not be run.") |
|---|
| 19 |
else: |
|---|
| 20 |
SM_class = "dejavu.storage.storeado.StorageManagerADO_MSAccess" |
|---|
| 21 |
opts = {u'Connect': "PROVIDER=MICROSOFT.JET.OLEDB.4.0;" |
|---|
| 22 |
"DATA SOURCE=zoo.mdb;", |
|---|
| 23 |
u'Expanded Columns': "Animal.PreviousZoos:int", |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
def run(): |
|---|
| 27 |
import zoo_fixture |
|---|
| 28 |
|
|---|
| 29 |
reload(zoo_fixture) |
|---|
| 30 |
zoo_fixture.init() |
|---|
| 31 |
zoo_fixture.run(SM_class, opts) |
|---|
| 32 |
|
|---|
| 33 |
if __name__ == "__main__": |
|---|
| 34 |
run() |
|---|