Author: jmorliaguet
Date: Wed May  3 20:03:21 2006
New Revision: 3037

Added:
   cpsskins/branches/paris-sprint-2006/ftests/installation.txt   (contents, 
props changed)
   cpsskins/branches/paris-sprint-2006/ftests/test_installation.py   (contents, 
props changed)
Log:

- added browser tests for the installation process



Added: cpsskins/branches/paris-sprint-2006/ftests/installation.txt
==============================================================================
--- (empty file)
+++ cpsskins/branches/paris-sprint-2006/ftests/installation.txt Wed May  3 
20:03:21 2006
@@ -0,0 +1,96 @@
+
+=================
+INSTALLATION TEST
+=================
+
+    >>> root = getRootFolder()
+
+Create a site folder:
+
+    >>> from zope.app.folder import Folder
+    >>> site = Folder()
+    >>> root[u'site'] = site
+
+Register the site as a local site manager:
+
+    >>> from zope.app.component.site import LocalSiteManager
+    >>> sm = LocalSiteManager(site)
+    >>> site.setSiteManager(sm)
+
+Manage the site:
+
+    >>> from zope.testbrowser.testing import Browser
+    >>> browser = Browser()
+    >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+    >>> browser.addHeader('Accept-Language', 'en-US')
+
+    >>> list(sm.keys())
+    [u'default']
+
+Add a 'Theme Management Folder':
+
+    >>> browser.open('http://localhost/site/++etc++site/manage')
+    >>> browser.getLink('Theme Management Folder').click()
+
+    >>> browser.getControl(name='new_value').value = u'themes'
+    >>> browser.getControl('Apply').click()
+
+Test the presence of the Theme Management Folder:
+
+    >>> from cpsskins.thememanager import IThemeManagementFolder
+    >>> list(sm.keys())
+    [u'default', u'themes']
+
+    >>> IThemeManagementFolder.providedBy(sm[u'themes'])
+    True
+
+    >>> tmutil = sm[u'themes']
+
+It is not registered yet:
+
+    >>> browser.open(
+    ...     'http://localhost/site/++etc++site/themes/@@themes-manager.html')
+    >>> 'Themes are currently disabled.' in browser.contents
+    True
+
+    >>> sm.queryUtility(IThemeManagementFolder) is None
+    True
+
+Enable the themes:
+
+    >>> browser.getControl('Enable themes').click()
+    >>> 'Themes are currently disabled.' in browser.contents
+    False
+
+    >>> sm.queryUtility(IThemeManagementFolder) is tmutil
+    True
+
+Currently there are no themes:
+
+    >>> tmutil.getThemes() == []
+    True
+
+Add a theme:
+
+    >>> browser.getControl('Add a theme').click()
+    >>> len(tmutil.getThemes()) == 1
+    True
+
+Add another theme:
+
+    >>> browser.getControl('Add a theme').click()
+    >>> len(tmutil.getThemes()) == 2
+    True
+
+Disable the themes:
+
+    >>> browser.getControl('Disable themes').click()
+    >>> 'Themes are currently disabled.' in browser.contents
+    True
+
+    >>> sm.queryUtility(IThemeManagementFolder) is None
+    True
+
+Cleanup:
+
+    >>> del root[u'site']

Added: cpsskins/branches/paris-sprint-2006/ftests/test_installation.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/paris-sprint-2006/ftests/test_installation.py     Wed May 
 3 20:03:21 2006
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Installation tests
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import unittest
+
+from zope.app.testing.functional import FunctionalDocFileSuite
+
+from cpsskins.tests.setup import setUp
+
+def test_suite():
+    return unittest.TestSuite((
+        FunctionalDocFileSuite('installation.txt', setUp=setUp),
+        ))
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to