[Zope3-checkins] CVS: zopeproducts/zwiki/tests - __init__.py:1.1 test_wiki.py:1.1 test_wikipage.py:1.1 test_wikipagehierarchy.py:1.1

Stephan Richter srichter@cbu.edu
Sat, 5 Apr 2003 15:50:05 -0500


Update of /cvs-repository/zopeproducts/zwiki/tests
In directory cvs.zope.org:/tmp/cvs-serv19546/zwiki/tests

Added Files:
	__init__.py test_wiki.py test_wikipage.py 
	test_wikipagehierarchy.py 
Log Message:
Initial ZWiki for Zope 3 checkin. Much thanks goes to Simon Michael who 
helped me out getting this first piece of rendering right.

Features so far:

  - Wiki object. Container of all Wiki pages.

  - WikiPage content object, holding the data, which turned out to be tiny.

  - Beginnings of the PageHierarchyAdapter...no view and not tested.

  - Rendered code recognizes Wiki names, the escaping '!' and the '[]' for
    all lower case Wiki names.

  - Generated Links bring you either to another Wiki page or to an add page.

Immediate to dos:

  - Get tests running. 

  - Add tests for the rendering.

  - Implement PageHierarchy support (maybe write own traverser).

  - Implement stx and/or rest support.


I hope that Simon will really get into the project and contribute all of 
his know-how on Wikis. :-)

I find that the Developer experience has drastically improved since I last
tried to develop a product (bug collector) for Zope 3. There are still 
some rough edges, but that's okay - at least I do not feel like missing
features left and right.


=== Added File zopeproducts/zwiki/tests/__init__.py ===


=== Added File zopeproducts/zwiki/tests/test_wiki.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""ZWiki Tests

$Id: test_wiki.py,v 1.1 2003/04/05 20:50:04 srichter Exp $
"""
from zope.app.container.tests.test_icontainer import BaseTestIContainer
from zopeproducts.zwiki.zwiki import ZWiki


class Test(BaseTestIContainer):

    def makeTestObject(self):
        return ZWiki()


def test_suite():
    return TestSuite((
        makeSuite(Test),
        ))



=== Added File zopeproducts/zwiki/tests/test_wikipage.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""ZWiki Tests

$Id: test_wikipage.py,v 1.1 2003/04/05 20:50:04 srichter Exp $
"""
from zopeproducts.zwiki.zwiki import ZWikiPage


class Test(BaseTestIContainer):

    def makeTestObject(self):
        return ZWikiPage()

    def test_Interface(self):
        page = self.makeTestObject()
        self.failUnless(IWikiPage.isImplementedBy(page))

    def test_source(self):
        page = self.makeTestObject()
        self.assertEqual('', page.source)
        page.source = 'foo'
        self.assertEqual('foo', page.source)

    def test_type(self):
        page = self.makeTestObject()
        self.assertEqual('plain text', page.type)
        page.type = 'foo'
        self.assertEqual('foo', page.type)

    def test_append(self):
        page = self.makeTestObject()
        page.source = 'the source'
        page.append(', more source')
        self.assertEqual('the source, more source', page.source)

    def test_comment(self):
        page = self.makeTestObject()
        page.source = 'the source'
        page.comment('this is a comment', 'user')
        self.assertEqual(
            'the source\n\nComment #1 by user\nthis is a comment',
            page.source)
        

def test_suite():
    return TestSuite((
        makeSuite(Test),
        ))



=== Added File zopeproducts/zwiki/tests/test_wikipagehierarchy.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (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.
#
##############################################################################
"""ZWiki Tests

$Id: test_wikipagehierarchy.py,v 1.1 2003/04/05 20:50:04 srichter Exp $
"""
from zopeproducts.zwiki.zwiki import ZWikiPage, ZWikiPageHierarchy


class Test(BaseTestIContainer):

    def makeTestObject(self):
        return ZWikiPageHierarchy(ZWikiPage())

    def test_Interface(self):
        hier = self.makeTestObject()
        self.failUnless(IWikiPageHierarchy.isImplementedBy(hier))

    def test_parents(self):
        hier = self.makeTestObject()
        self.assertEqual([], hier.parents)
        hier.parents = ['foo']
        self.assertEqual(['foo'], hier.parents)

    def test_reparent(self):
        hier = self.makeTestObject()
        hier.parents = ['foo']
        self.assertEqual(['foo'], hier.parents)
        hier.reparent(['bar'])
        self.assertEqual(['bar'], hier.parents)


def test_suite():
    return TestSuite((
        makeSuite(Test),
        ))