view MoinMoin/_tests/ @ 2006:1339d6fdc4ff

Changed tests to use py.test. Also changed the semantics a bit - the test wiki directory is only created freshly if it does not exist.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Fri, 20 Apr 2007 00:12:50 +0200
parents bb2e053067fb
children ff428fa12e3c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - MoinMoin.Page Tests

    @copyright: 2003-2004 by Juergen Hermann <>
    @license: GNU GPL, see COPYING for details.

import unittest
from MoinMoin import Page

class TestExists(unittest.TestCase):
    """Page: testing wiki page"""

    def testExists(self):
        """ Page: page.exists() finds existing pages only """
        tests = (
            # Page name,                            expected
            ('FrontPage',                           1),
            ('OnlyAnIdiotWouldCreateSuchaPage',     0),
        for name, expected in tests:
            pg = Page.Page(self.request, name)
            self.assertEqual(pg.exists(), expected,
                             '%s should%s exist' % (name, (' not', '')[expected]))