view MoinMoin/_tests/ @ 4781:cee722c2097c

Groups2009: is used for the groups-related configuration instead of altering in _tests.
author Dmitrijs Milajevs <>
date Wed, 03 Jun 2009 12:10:14 +0200
parents 3f9147c23d9c
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - MoinMoin.wikidicts tests

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

import py
import re
import shutil

from MoinMoin import wikidicts
from MoinMoin import Page
from MoinMoin.PageEditor import PageEditor
from MoinMoin.user import User
from MoinMoin._tests import append_page, become_trusted, create_page, create_random_string_list, nuke_page, nuke_user

class TestDictPage:

    def testGroupMembers(self):
        """ wikidicts: create dict from keys and values in text """
        text = '''
Text ignored
 * list items ignored
  * Second level list ignored
 First:: first item
 text with spaces:: second item

Empty lines ignored, so is this text
Next line has key with empty value
 Empty string::\x20
 Last:: last item
        d = wikidicts.Dict(self.request, '')
        assert d['First'] == 'first item'
        assert d['text with spaces'] == 'second item'
        assert d['Empty string'] == '' # XXX fails if trailing blank is missing
        assert d['Last'] == 'last item'
        assert len(d) == 4

coverage_modules = ['MoinMoin.wikidicts']