Ignore:
Timestamp:
8 Jun 2009, 16:59:22 (15 years ago)
Author:
uli
Message:

Update tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.txt

    r4162 r4223  
    8888    ... """)
    8989
    90 We get a suitable importer by asking for an adapter to
    91 IWAeUPCSVExporter (see section above for details):
     90We get a suitable importer by asking for a multi-adapter to
     91our file and IWAeUPCSVExporter (see section above, the importexport
     92module and the `waeup.csvfile` README for details):
    9293
     94    >>> from waeup.csvfile import getCSVFile
    9395    >>> from waeup.interfaces import IWAeUPCSVImporter
    94     >>> importer = IWAeUPCSVImporter(mycontainer)
     96    >>> from zope.component import getMultiAdapter
     97    >>> importer = getMultiAdapter((getCSVFile('myfaculties.csv'),
     98    ...                             mycontainer),
     99    ...                            IWAeUPCSVImporter)
    95100    >>> importer
    96101    <waeup.university.facultycontainer.FacultyCSVImporter object at 0x...>
     
    113118Now we can easily import the data:
    114119
    115     >>> importer.doImport('myfaculties.csv')
     120    >>> importer.doImport()
    116121
    117122The container is now filled:
     
    124129
    125130
    126 We can validate data of CSV files without actually importing
    127 them. This can help for instance while checking uploaded files:
    128 
    129     >>> importer.validate('myfaculties.csv')
    130     True
    131 
    132131Clean up:
    133132
Note: See TracChangeset for help on using the changeset viewer.