Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test infrastructure, update buildout.cfg, add squinx docs
- Loading branch information
Maik Derstappen
committed
Dec 4, 2011
1 parent
9d1be50
commit 812c204
Showing
9 changed files
with
262 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,77 @@ | |||
from Products.CMFCore.utils import getToolByName | |||
|
|||
from plone.app.testing import PloneSandboxLayer | |||
from plone.app.testing import applyProfile | |||
from plone.app.testing import PLONE_FIXTURE | |||
from plone.app.testing import IntegrationTesting | |||
from plone.app.testing import FunctionalTesting | |||
|
|||
from plone.testing import z2 | |||
|
|||
from zope.configuration import xmlconfig | |||
|
|||
class CMFContentPanels(PloneSandboxLayer): | |||
defaultBases = (PLONE_FIXTURE,) | |||
|
|||
USER_NAME = 'johndoe' | |||
USER_PASSWORD = 'secret' | |||
MEMBER_NAME = 'janedoe' | |||
MEMBER_PASSWORD = 'secret' | |||
USER_WITH_FULLNAME_NAME = 'freddie' | |||
USER_WITH_FULLNAME_FULLNAME = 'Freddie Mercury' | |||
USER_WITH_FULLNAME_PASSWORD = 'secret' | |||
MANAGER_USER_NAME = 'manager' | |||
MANAGER_USER_PASSWORD = 'secret' | |||
|
|||
def setUpZope(self, app, configurationContext): | |||
# Load ZCML | |||
import Products.CMFContentPanels | |||
xmlconfig.file('configure.zcml', | |||
Products.CMFContentPanels, | |||
context=configurationContext) | |||
with z2.zopeApp() as app: | |||
z2.installProduct(app, 'Products.CMFContentPanels') | |||
|
|||
def setUpPloneSite(self, portal): | |||
# Install into Plone site using portal_setup | |||
applyProfile(portal, 'Products.CMFContentPanels:default') | |||
# Creates some users | |||
acl_users = getToolByName(portal, 'acl_users') | |||
acl_users.userFolderAddUser( | |||
self.USER_NAME, | |||
self.USER_PASSWORD, | |||
[], | |||
[], | |||
) | |||
acl_users.userFolderAddUser( | |||
self.MEMBER_NAME, | |||
self.MEMBER_PASSWORD, | |||
['Member'], | |||
[], | |||
) | |||
acl_users.userFolderAddUser( | |||
self.USER_WITH_FULLNAME_NAME, | |||
self.USER_WITH_FULLNAME_PASSWORD, | |||
['Member'], | |||
[], | |||
) | |||
mtool = getToolByName(portal, 'portal_membership', None) | |||
mtool.addMember(self.USER_WITH_FULLNAME_NAME, self.USER_WITH_FULLNAME_NAME, ['Member'], []) | |||
mtool.getMemberById(self.USER_WITH_FULLNAME_NAME).setMemberProperties({"fullname": | |||
self.USER_WITH_FULLNAME_FULLNAME}) | |||
|
|||
acl_users.userFolderAddUser( | |||
self.MANAGER_USER_NAME, | |||
self.MANAGER_USER_PASSWORD, | |||
['Manager'], | |||
[], | |||
) | |||
|
|||
CMFCONTENTPANELS_FIXTURE = CMFContentPanels() | |||
CMFCONTENTPANELS_INTEGRATION_TESTING = IntegrationTesting( | |||
bases=(CMFCONTENTPANELS_FIXTURE,), | |||
name="CMFContentPanels:Integration") | |||
CMFCONTENTPANELS_FUNCTIONAL_TESTING = FunctionalTesting( | |||
bases=(CMFCONTENTPANELS_FIXTURE,), | |||
name="CMFContentPanels:Functional") | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,37 @@ | |||
import unittest2 as unittest | |||
from Products.CMFCore.utils import getToolByName | |||
from plone.app.testing import TEST_USER_ID, TEST_USER_NAME, setRoles, login | |||
from Products.CMFContentPanels.testing import CMFCONTENTPANELS_INTEGRATION_TESTING | |||
|
|||
|
|||
class ContentPanelTest(unittest.TestCase): | |||
|
|||
layer = CMFCONTENTPANELS_INTEGRATION_TESTING | |||
|
|||
def setUp(self): | |||
self.portal = self.layer["portal"] | |||
self.request = self.layer["request"] | |||
|
|||
setRoles(self.portal, TEST_USER_ID, ['Manager']) | |||
login(self.portal, TEST_USER_NAME) | |||
self.portal.invokeFactory(id='doc1', | |||
title='Document 1', | |||
type_name='Document') | |||
self.catalog = getToolByName(self.portal, 'portal_catalog') | |||
self.document_brain = self.catalog.searchResults( | |||
portal_type = 'Document')[0] | |||
|
|||
def test_factory(self): | |||
contentpanels1_id = self.portal.invokeFactory(id='cp1', | |||
title='Content Panel 1', | |||
type_name='ContentPanels') | |||
self.assertEqual(contentpanels1_id, 'cp1') | |||
self.assertIn('cp1', self.portal.objectIds()) | |||
self.assertEqual(self.portal[contentpanels1_id].portal_type, 'ContentPanels') | |||
|
|||
|
|||
|
|||
|
|||
|
|||
def test_suite(): | |||
return unittest.defaultTestLoader.loadTestsFromName(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,7 +1,91 @@ | |||
[buildout] | [buildout] | ||
extends = | |||
http://svn.plone.org/svn/collective/buildout/plonetest/plone-4.1.x.cfg | |||
|
|||
package-name = Products.CMFContentPanels | |||
package-directory = Products/CMFContentPanels | |||
|
|||
extensions = buildout.eggtractor | |||
tractor-src-directory = | |||
. | |||
src | |||
|
|||
parts += | parts += | ||
omelette | |||
releaser | releaser | ||
test | |||
# xmltest | |||
coverage | |||
report | |||
zopepy | |||
sphinxbuilder | |||
sphinxupload | |||
|
|||
|
|||
[instance] | |||
eggs += | |||
PILwoTK | |||
Products.PdbDebugMode | |||
Products.PrintingMailHost | |||
Sphinx | |||
Sphinx-PyPI-upload | |||
repoze.sphinx.autointerface | |||
iw.debug | |||
|
|
||
[releaser] | [releaser] | ||
recipe = zc.recipe.egg | recipe = zc.recipe.egg | ||
eggs = zest.releaser | eggs = zest.releaser | ||
|
|||
[test] | |||
recipe = zc.recipe.testrunner | |||
eggs = ${buildout:package-name} [test] | |||
defaults = ['--auto-color', '--auto-progress'] | |||
|
|||
[coverage] | |||
recipe = zc.recipe.egg | |||
eggs = coverage | |||
initialization = | |||
include = '--source=${buildout:directory}/src' | |||
sys.argv = sys.argv[:] + ['run', include, 'bin/test', '--all'] | |||
|
|||
[report] | |||
recipe = zc.recipe.egg | |||
eggs = coverage | |||
scripts = coverage=report | |||
initialization = | |||
sys.argv = sys.argv[:] + ['html', '-i'] | |||
|
|||
[omelette] | |||
recipe = collective.recipe.omelette | |||
eggs = ${instance:eggs} | |||
packages = ${instance:location}/lib/python ./ | |||
|
|||
#[xmltest] | |||
#recipe = collective.xmltestreport | |||
#eggs = ${buildout:package-name} [test] | |||
#defaults = ['--auto-color', '--auto-progress'] | |||
|
|||
[zopepy] | |||
recipe = zc.recipe.egg | |||
eggs = ${instance:eggs} | |||
interpreter = zopepy | |||
scripts = zopepy | |||
|
|||
[sphinxbuilder] | |||
recipe = collective.recipe.sphinxbuilder | |||
interpreter = ${buildout:directory}/bin/zopepy | |||
source = ${buildout:directory}/docs | |||
build = ${buildout:directory}/docs/_build | |||
outputs = | |||
html | |||
latex | |||
|
|||
[sphinxupload] | |||
recipe = collective.recipe.template | |||
input = inline: | |||
#!/bin/sh | |||
bin/zopepy setup.py upload_sphinx | |||
output = ${buildout:directory}/bin/sphinxupload | |||
mode = 755 | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
.. Products.CMFContentPanels documentation master file, created by | |||
sphinx-quickstart on Tue Nov 22 21:33:11 2011. | |||
You can adapt this file completely to your liking, but it should at least | |||
contain the root `toctree` directive. | |||
|
|||
Welcome to Products.CMFContentPanels's documentation! | |||
===================================================== | |||
|
|||
Contents: | |||
|
|||
.. toctree:: | |||
:maxdepth: 2 | |||
|
|||
Indices and tables | |||
================== | |||
|
|||
* :ref:`genindex` | |||
* :ref:`modindex` | |||
* :ref:`search` | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,3 @@ | |||
[egg_info] | [egg_info] | ||
tag_build = dev | #tag_build = dev | ||
tag_svn_revision = false | tag_svn_revision = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,32 +1,41 @@ | |||
from setuptools import setup, find_packages | from setuptools import setup, find_packages | ||
import os | import os | ||
|
|
||
version = open(os.path.join("Products", "CMFContentPanels", "version.txt")).read().strip() | version = '2.6a11dev' | ||
|
|
||
setup(name='Products.CMFContentPanels', | setup( | ||
version=version, | name='Products.CMFContentPanels', | ||
description="CMFContentPanels is a plone portlets product to build composite pages", | version=version, | ||
long_description=open(os.path.join("Products", "CMFContentPanels", "README.txt")).read().decode('UTF8').encode('ASCII', 'replace'), | description="CMFContentPanels is a plone portlets product to build composite pages", | ||
# Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers | long_description=open( | ||
classifiers=[ | os.path.join("Products", "CMFContentPanels", "README.txt") | ||
).read().decode('UTF8').encode('ASCII', 'replace'), | |||
# Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers | |||
classifiers=[ | |||
"Programming Language :: Python", | "Programming Language :: Python", | ||
"Framework :: Plone" | "Framework :: Plone" | ||
], | ], | ||
keywords='plone web composite_pages CMFContentPanels', | keywords='plone web composite_pages CMFContentPanels', | ||
author='Erico Andrei', | maintainer='Erico Andrei, Maik Derstappen <maik.derstappen@inqbus.de>', | ||
author_email='erico@simplesconsultoria.com.br', | author='Erico Andrei', | ||
url='http://svn.plone.org/svn/collective/Products.CMFContentPanels/', | author_email='erico@simplesconsultoria.com.br', | ||
license='GPL', | url='http://github.com/collective/Products.CMFContentPanels', | ||
packages=find_packages(exclude=['ez_setup']), | license='GPL', | ||
namespace_packages=['Products'], | packages=find_packages(exclude=['ez_setup']), | ||
include_package_data=True, | namespace_packages=['Products'], | ||
zip_safe=False, | include_package_data=True, | ||
install_requires=[ | zip_safe=False, | ||
'setuptools', | install_requires=[ | ||
# -*- Extra requirements: -*-, | 'setuptools', | ||
'feedparser', | # -*- Extra requirements: -*-, | ||
], | 'feedparser', | ||
entry_points=""" | ], | ||
# -*- Entry points: -*- | extras_require = { | ||
""", | 'test': [ | ||
) | 'plone.app.testing', | ||
] | |||
}, | |||
entry_points=""" | |||
# -*- Entry points: -*- | |||
""", | |||
) |