view MoinMoin/_tests/wikiconfig.py @ 4027:0d6724b87856

Refactored TestConfig creation for py.test based unit tests. The method used before had multiple problems: config creation did not use inheritance (as it does when used the wiki in production). It also didn't do the post processing done in __init__ of Config class. Also, it first created the request with some default config, then created the TestConfig (but some stuff in request was not initialized correctly)... The new method now uses config inheritance in the same way as a production wiki does. The TestConfig instance is created in RequestBase __init__, it does not use sys.path any more to import the test wikiconfig, but does an absolute import from MoinMoin._tests.wikiconfig. TODO: * fix the failing test_pysupport.TestImportExisting.testExisting * auth tests are currently skipped because they need more work * find a better way than staticmethod(TestConfig)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 02:01:34 +0200
parents tests/wikiconfig.py@e5a9570d3001
children d85a2b2f120b
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - test wiki configuration

Do not change any values without good reason.

We mostly want to have default values here, except for stuff that doesn't
work without setting them (like data_dir and underlay_dir).

@copyright: 2000-2004 by Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""

import os

from MoinMoin.config.multiconfig import DefaultConfig


class Config(DefaultConfig):
    sitename = u'Developer Test Wiki'
    logo_string = sitename

    _base_dir = os.path.join(os.path.dirname(__file__), '../../tests/wiki')
    data_dir = os.path.join(_base_dir, "data")
    data_underlay_dir = os.path.join(_base_dir, "underlay")

    #show_hosts = 1

    #secrets = 'some not secret string just to make tests happy'

    # used to check if it is really a wiki we may modify
    is_test_wiki = True