~launchpad-pqm/launchpad/devel

9492.1.1 by Karl Fogel
Add utilities/formatdoctest.py and utilities/migrater/, both brought
1
# Copyright 2009 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 view tests.
6
"""
7
8
import logging
9
import os
10
import unittest
11
12
from canonical.launchpad.testing.systemdocs import (
13
    LayeredDocFileSuite, setUp, tearDown)
14
from canonical.testing import LaunchpadFunctionalLayer
15
16
17
here = os.path.dirname(os.path.realpath(__file__))
18
19
20
def test_suite():
21
    suite = unittest.TestSuite()
22
    testsdir = os.path.abspath(here)
23
24
    # Add tests using default setup/teardown
25
    filenames = [filename
26
                 for filename in os.listdir(testsdir)
27
                 if filename.endswith('.txt')]
28
    # Sort the list to give a predictable order.
29
    filenames.sort()
30
    for filename in filenames:
31
        path = filename
32
        one_test = LayeredDocFileSuite(
33
            path, setUp=setUp, tearDown=tearDown,
34
            layer=LaunchpadFunctionalLayer,
35
            stdout_logging_level=logging.WARNING
36
            )
37
        suite.addTest(one_test)
38
39
    return suite