Changeset 8227 for main/waeup.kofa/trunk


Ignore:
Timestamp:
20 Apr 2012, 06:03:31 (13 years ago)
Author:
Henrik Bettermann
Message:

Perform tests in th eright order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.txt

    r8224 r8227  
    496496This time we get even an exception!
    497497
     498Generally, empty strings are considered as ``None``:
     499
     500    >>> open('newcomers.csv', 'wb').write(
     501    ... """name,dinoports,owner
     502    ... "Wilmas Asylum","","Wilma"
     503    ... """)
     504
     505    >>> result = processor.doImport('newcomers.csv', ['name',
     506    ...                             'dinoports', 'owner'],
     507    ...                    mode='update', user='Bob')
     508    >>> result
     509    (1, 0, '...', None)
     510
     511    >>> wilma.dinoports
     512    2
     513
     514Clean up:
     515
     516    >>> shutil.rmtree(os.path.dirname(result[2]))
     517
    498518We can tell to set dinoports to ``None`` although this is not a
    499519number, as we declared the field not required in the interface:
     
    501521    >>> open('newcomers.csv', 'wb').write(
    502522    ... """name,dinoports,owner
    503     ... "Wilmas Asylum",,"Wilma"
     523    ... "Wilmas Asylum","XXX","Wilma"
    504524    ... """)
    505525
     
    516536
    517537    >>> shutil.rmtree(os.path.dirname(result[2]))
    518 
    519 Generally, empty strings are considered as ``None``:
    520 
    521     >>> open('newcomers.csv', 'wb').write(
    522     ... """name,dinoports,owner
    523     ... "Wilmas Asylum","","Wilma"
    524     ... """)
    525 
    526     >>> result = processor.doImport('newcomers.csv', ['name',
    527     ...                             'dinoports', 'owner'],
    528     ...                    mode='update', user='Bob')
    529     >>> result
    530     (1, 0, '...', None)
    531 
    532     >>> wilma.dinoports is None
    533     True
    534 
    535 Clean up:
    536 
    537     >>> shutil.rmtree(os.path.dirname(result[2]))
    538 
    539538
    540539Removing entries
Note: See TracChangeset for help on using the changeset viewer.