Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

Changeset 158

Show
Ignore:
Timestamp:
02/11/06 06:06:40
Author:
fumanchu
Message:

New test for pythoncom in test_storemsaccess.py; warn if not importable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/test_storemsaccess.py

    r157 r158  
    22the Access SM will crash python.""" 
    33 
    4 from dejavu.storage import storeado 
    5 mod = storeado.gen_py() 
    6 if mod is None: 
     4import warnings 
     5 
     6try: 
     7    import pythoncom 
     8except ImportError: 
    79    def run(): 
    8         import warnings 
    9         warnings.warn("ADO 2.7 support could not be verified. " 
     10        warnings.warn("The pythoncom module could not be imported. " 
    1011                      "The MSAccess test will not be run.") 
    1112else: 
    12     SM_class = "dejavu.storage.storeado.StorageManagerADO_MSAccess" 
    13     opts = {u'Connect': "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=zoo.mdb;", 
    14             u'Expanded Columns': "Animal.PreviousZoos:int", 
    15             } 
    16      
    17     def run(): 
    18         import zoo_fixture 
    19         # Isolate schema changes from one test to the next. 
    20         reload(zoo_fixture) 
    21         zoo_fixture.init() 
    22         zoo_fixture.run(SM_class, opts) 
     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            # Isolate schema changes from one test to the next. 
     29            reload(zoo_fixture) 
     30            zoo_fixture.init() 
     31            zoo_fixture.run(SM_class, opts) 
    2332 
    2433if __name__ == "__main__":