|
Revision 100
(checked in by fumanchu, 3 years ago)
|
More test suite work. If a store is not installed or cannot be imported, a warning will be raised and the tests will not be run.
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
def create_access_db(): |
|---|
| 3 |
|
|---|
| 4 |
import win32com.client |
|---|
| 5 |
cat = win32com.client.Dispatch(r'ADOX.Catalog') |
|---|
| 6 |
cat.Create("PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=zooodbc.mdb;") |
|---|
| 7 |
|
|---|
| 8 |
create_access_db() |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
opts = {u'Connect': ("Provider=MSDASQL;" |
|---|
| 13 |
"Driver={Microsoft Access Driver (*.mdb)};" |
|---|
| 14 |
"DBQ=zooodbc.mdb;Provider=MSDASQL;"), |
|---|
| 15 |
u'Expanded Columns': "Animal.PreviousZoos:int", |
|---|
| 16 |
} |
|---|
| 17 |
SM_class = "dejavu.storage.storeodbc.StorageManagerODBC" |
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
if __name__ == "__main__": |
|---|
| 21 |
import zoo_fixture |
|---|
| 22 |
try: |
|---|
| 23 |
zoo_fixture.run(SM_class, opts) |
|---|
| 24 |
finally: |
|---|
| 25 |
try: |
|---|
| 26 |
import os; os.remove("zooodbc.mdb") |
|---|
| 27 |
except OSError: |
|---|
| 28 |
print "Could not remove database." |
|---|
| 29 |
|
|---|