Changeset 5140 for main


Ignore:
Timestamp:
12 Apr 2010, 14:28:51 (15 years ago)
Author:
uli
Message:

Update all unit tests that use the ZCA to run inside the new unit test layer.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/README.txt

    r5072 r5140  
    22**********************
    33
    4 :Test-Layer: unit
     4.. :doctest:
     5.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    56
    67A portal software for student registration.
    7 
    8 Prerequisites
    9 =============
    10 
    11 Before we can work with the environment, we have to register all the
    12 utilities, adapters, etc. We grok the `waeup` package to do that::
    13 
    14   >>> import grok
    15   >>> grok.testing.grok('waeup.sirp')
    168
    179Universities
  • main/waeup.sirp/trunk/src/waeup/sirp/app.txt

    r4920 r5140  
    22**************************************************************
    33
    4 :Test-Layer: unit
     4.. :doctest:
     5.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    56
    67.. module:: waeup.sirp.app
     
    3132whole :mod:`waeup` package. This way all interfaces, utilities and adapters
    3233defined in the package are looked up and registered with the global
    33 registries:
    34 
    35     >>> import grok
    36     >>> grok.testing.grok('waeup')
     34registries (this is done by the testlayer automatically).
    3735
    3836Now we can import the :class:`University` class and create an
  • main/waeup.sirp/trunk/src/waeup/sirp/catalog.txt

    r5094 r5140  
    88
    99.. :doctest:
    10 
     10.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    1111
    1212.. contents::
  • main/waeup.sirp/trunk/src/waeup/sirp/datacenter.txt

    r4999 r5140  
    44The WAeUP data center cares for managing CSV files and importing then.
    55
    6 :Test-Layer: unit
     6.. :doctest:
     7.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    78
    89Creating a data center
  • main/waeup.sirp/trunk/src/waeup/sirp/hostel/hostelcontainer.txt

    r4920 r5140  
    44Containers for hostels.
    55
    6 :Test-Layer: unit
     6.. :doctest:
     7.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    78
    89Getting a hostel container
     
    2223Another way to get a hostel container -- without importing the class
    2324-- is via factories. We registered a factory for hostel containers
    24 under the name ``waeup.HostelContainer``::
    25 
    26     >>> import grok
    27     >>> grok.testing.grok('waeup')
    28 
    29 Now we can ask for an object by calling the appropriate factory:
     25under the name ``waeup.HostelContainer``. So we can ask for an object
     26by calling the appropriate factory:
    3027
    3128    >>> from zope.component import createObject
  • main/waeup.sirp/trunk/src/waeup/sirp/permissions.txt

    r4920 r5140  
    44Permissions and roles used in a WAeUP portal.
    55
    6 :Test-Layer: unit
    7 
    8 
    9 Before we can do something useful with roles and permissions, we have
    10 to register them. This can be done simply by grokking the `waeup`
    11 package:
    12 
    13     >>> import grok
    14     >>> grok.testing.grok('waeup')
     6.. :doctest:
     7.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    158
    169We can get all roles defined in a WAeUP portal:
  • main/waeup.sirp/trunk/src/waeup/sirp/university/certificate.txt

    r5005 r5140  
    66Components that represent and manage certificates.
    77
    8 :Test-Layer: unit
    9 
    10 Because certificates make use of components registered with the Zope
    11 Component Architecture (ZCA), we first have to grok the `waeup`
    12 package. This happens automatically in real-world use:
    13 
    14     >>> import grok
    15     >>> grok.testing.grok('waeup')
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    1610
    1711
  • main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.txt

    r5005 r5140  
    66Containers for certificates.
    77
    8 :Test-Layer: unit
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    910
    10 Because this module makes use of components registered with the Zope
    11 Component Architecture (ZCA), we first have to grok the `waeup`
    12 package if we want to deploy it. This happens automatically in
    13 real-world use:
    14 
    15     >>> import grok
    16     >>> grok.testing.grok('waeup')
    1711
    1812Content Classes (models and containers)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/course.txt

    r5005 r5140  
    66Components that represent courses.
    77
    8 :Test-Layer: unit
    9 
    10 Because this module makes use of components registered with the Zope
    11 Component Architecture (ZCA), we first have to grok the `waeup`
    12 package if we want to deploy it. This happens automatically in
    13 real-world use:
    14 
    15     >>> import grok
    16     >>> grok.testing.grok('waeup')
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    1710
    1811Content Classes (models and containers)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/coursecontainer.txt

    r5005 r5140  
    66Containers for courses.
    77
    8 :Test-Layer: unit
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    910
    10 Because this module makes use of components registered with the Zope
    11 Component Architecture (ZCA), we first have to grok the `waeup`
    12 package if we want to deploy it. This happens automatically in
    13 real-world use:
    14 
    15     >>> import grok
    16     >>> grok.testing.grok('waeup')
    1711
    1812Content Classes (models and containers)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/department.txt

    r5005 r5140  
    66Components that represent university departments.
    77
    8 :Test-Layer: unit
    9 
    10 Before we can create departments, we have to grok the :mod:`waeup`
    11 package. This happens automatically in real-world use:
    12 
    13     >>> import grok
    14     >>> grok.testing.grok('waeup')
    15 
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    1610
    1711Content Classes (models and containers)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/faculty.txt

    r5005 r5140  
    66Components that represent university faculties.
    77
    8 :Test-Layer: unit
    9 
    10 Before we can create faculties, we have to grok the :mod:`waeup`
    11 package. This happens automatically in real-world use:
    12 
    13     >>> import grok
    14     >>> grok.testing.grok('waeup')
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
     10
    1511
    1612Content Classes (models and containers)
  • main/waeup.sirp/trunk/src/waeup/sirp/university/facultycontainer.txt

    r5015 r5140  
    66Components that represent faculty containers.
    77
    8 :Test-Layer: unit
    9 
    10 Before we can create faculty containers, we have to grok the
    11 :mod:`waeup.sirp` package. This happens automatically in real-world
    12 use:
    13 
    14     >>> import grok
    15     >>> grok.testing.grok('waeup.sirp')
     8.. :doctest:
     9.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    1610
    1711
  • main/waeup.sirp/trunk/src/waeup/sirp/users.txt

    r4920 r5140  
    22*************************
    33
    4 :Test-Layer: unit
     4.. :doctest:
     5.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    56
    67Before we can start, we need some password managers available:
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/converters.txt

    r5012 r5140  
    99
    1010
    11 :Test-Layer: unit
    12 
    13 As converters are registered as adapters, we have to grok the package
    14 first:
    15 
    16     >>> import grok
    17     >>> grok.testing.grok('waeup')
     11.. :doctest:
     12.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
     13
    1814
    1915Constants
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.txt

    r4920 r5140  
    66Helper functions for the WAeUP SRP.
    77
    8 :Test-Layer: unit
     8.. :doctest:
    99
    1010:func:`removeFileOrDirectory`
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/importexport.txt

    r5011 r5140  
    55exportable and importable.
    66
    7 :Test-Layer: unit
     7.. :doctest:
     8.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    89
    910As imports and exports of data are a cruical point when doing updates
     
    1314Exports and imports are implemented using the Zope component framework
    1415capabilities. This means we need some adapters and utilities, which we
    15 register, by grokking the whole package::
    16 
    17     >>> import grok
    18     >>> grok.testing.grok('waeup')
     16register, by grokking the whole package. This is done on startup
     17automatically, but in doctests (like this one) it is done by the
     18testlayer.
    1919
    2020Furthermore we need something to import/export. As only pickable
  • main/waeup.sirp/trunk/src/waeup/sirp/widgets/table.txt

    r4942 r5140  
    55
    66
    7 :doctest:
     7.. :doctest:
     8.. :layer: waeup.sirp.testing.WAeUPSIRPUnitTestLayer
    89
    910Tables
     
    8182
    8283    >>> import grok
    83     >>> grok.testing.grok('waeup.sirp')
    8484    >>> from waeup.sirp.widgets.interfaces import ITableProvider
    8585    >>> class TableAdapter(grok.Adapter):
Note: See TracChangeset for help on using the changeset viewer.