Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > Plone Extensions

    ftw.testing 1.3

    Download button

    No screenshots available
    Downloads: 108  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jonas Baumann | More programs
    GPL / FREE
    May 24th, 2012, 13:10 GMT [view history]
    ROOT / Internet / Plone Extensions

     Read user reviews (0)  Refer to a friend  Subscribe

    ftw.testing description

    Provides some testing helpers and an advanced MockTestCase

    ftw.testing is a Python module that provides an advanced MockTestCase which provides bases on the plone.mocktestcase MockTestCase.

    The following additional methos are available:

    ``self.providing_mock(interfaces, *args, **kwargs)``
          Creates a mock which provides ``interfaces``.

    ``self.mock_interface(interface, provides=None, *args, **kwargs)``
          Creates a mock object implementing ``interface``. The mock does not
          only provide ``interface``, but also use it as specification and
          asserts that the mocked methods do exist on the interface.

    ``self.stub(*args, **kwargs)``
          Creates a stub. It acts like a mock but has no assertions.

    ``self.providing_stub(interfaces, *args, **kwargs)``
          Creates a stub which provides ``interfaces``.

    ``self.stub_interface(interface, provides=None, *args, **kwargs)``
          Does the same as ``mock_interface``, but disables counting of expected
          method calls and attribute access. See "Mocking vs. stubbing" below.

    ``self.set_parent(context, parent_context)``
          Stubs the ``context`` so that its acquision parent is ``parent_context``.
          Expects at least context to be a mock or a stub. Returns the ``context``.

    ``self.stub_request(interfaces=[], stub_response=True,
                         content_type='text/html', status=200)``
          Returns a request stub which can be used for rendering templates. With the
          ``stub respones`` option, you can define if the request should stub a
          response by him self. The other optional arguments:
          ``content_type``: Defines the expected output content type of the response.
          ``status``: Defines the expected status code of the response.

    ``self.stub_response(request=None, content_type='text/html', status=200))``
          Returns a stub response with some headers and options. When a ``request``
          is given the response would append also to the giver request.
          The other optional arguments:
          ``content_type``: Defines the expected output content type of the response.
          ``status``: Defines the expected status code of the response.

    ``self.assertRaises(*args, **kwargs)``
          Uses ``unittest2`` implementation of assertRaises instead of
          ``unittest`` implementation.

    It also fixes a problem in ``mock_tool``, where the ``getToolByName`` mock had assertions which is not very useful in some cases.


    Product's homepage

    Requirements:

    · Python
    · Plone CMS

    What's New in This Release: [ read full changelog ]

    · Drop official Plone 4.0 support. [jone]
    · Component registry layer: use isolated ZCML layers. When using the same layer instances it may conflict with integration or functional testing layers. [jone]
    · Add splinter integration and Plone page objects. [jone]
    · onegov.ch approved: add badge to readme. [jone]
    · MockTestCase: Support Products.PloneHotfix20121106 patch when mocking getToolByName. [jone]
    · MockTestCase: add checks that setUp is called correctly. [jone]

      


    TAGS:

    testing helpers | Python library | Python | MockTestCase | testing

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM