Changeset 4059 for waeup/branches


Ignore:
Timestamp:
3 Apr 2009, 10:57:19 (16 years ago)
Author:
uli
Message:

Update tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/utils/importexport.txt

    r4052 r4059  
    103103    >>> from waeup.interfaces import IWAeUPXMLImporter
    104104    >>> importer = IWAeUPXMLImporter(myfaculty)
     105
     106Importing from filenames
     107------------------------
     108
     109We can use a filepath to import from the denoted file::
     110
    105111    >>> new_obj = importer.doImport('myexport.xml')
    106112
     
    117123    >>> new_obj is myfaculty
    118124    False
     125
     126Importing from filelike objects
     127-------------------------------
     128
     129We can also pass a file-like object instead of a filepath::
     130
     131    >>> filelike_obj = open('myexport.xml', 'rb')
     132    >>> new_obj = importer.doImport(filelike_obj)
     133
     134The object created is indeed a faculty::
     135
     136    >>> new_obj
     137    <waeup.university.faculty.Faculty object at 0x...>
     138
     139Clean up::
     140
     141    >>> import os
     142    >>> os.unlink('myexport.xml')
Note: See TracChangeset for help on using the changeset viewer.