~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/webservice/tests/test_doc.py

  • Committer: Curtis Hovey
  • Date: 2011-12-22 14:49:30 UTC
  • mto: This revision was merged to the branch mainline in revision 14585.
  • Revision ID: curtis.hovey@canonical.com-20111222144930-lgeqd3ebdmzv9nwv
Moved webservice doc to lp.services.webservice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""
 
5
Run the doctests and pagetests.
 
6
"""
 
7
 
 
8
import os
 
9
 
 
10
from zope.testing.cleanup import cleanUp
 
11
 
 
12
from canonical.launchpad.testing import browser
 
13
from canonical.launchpad.testing.systemdocs import (
 
14
    LayeredDocFileSuite,
 
15
    setGlobs,
 
16
    )
 
17
from canonical.testing.layers import (
 
18
    AppServerLayer,
 
19
    LaunchpadFunctionalLayer,
 
20
    )
 
21
from lp.services.testing import build_test_suite
 
22
 
 
23
 
 
24
here = os.path.dirname(os.path.realpath(__file__))
 
25
 
 
26
 
 
27
def layerlessTearDown(test):
 
28
    """Clean up any Zope registrations."""
 
29
    cleanUp()
 
30
 
 
31
 
 
32
special = {
 
33
    'webservice-configuration.txt': LayeredDocFileSuite(
 
34
        '../doc/webservice-configuration.txt',
 
35
        setUp=setGlobs, tearDown=layerlessTearDown, layer=None),
 
36
    # This test is actually run twice to prove that the AppServerLayer
 
37
    # properly isolates the database between tests.
 
38
    'launchpadlib.txt': LayeredDocFileSuite(
 
39
        '../doc/launchpadlib.txt',
 
40
        layer=AppServerLayer,
 
41
        setUp=browser.setUp, tearDown=browser.tearDown,),
 
42
    'launchpadlib2.txt': LayeredDocFileSuite(
 
43
        '../doc/launchpadlib.txt',
 
44
        layer=AppServerLayer,
 
45
        setUp=browser.setUp, tearDown=browser.tearDown,),
 
46
    }
 
47
 
 
48
 
 
49
def test_suite():
 
50
    return build_test_suite(here, special, layer=LaunchpadFunctionalLayer)