~launchpad-pqm/launchpad/devel

8687.15.22 by Karl Fogel
Add the copyright header block to the remaining .py files.
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
8138.1.2 by Jonathan Lange
Run migrater over lp.code. Many tests broken and imports failing.
4
"""
5
Run the view tests.
6
"""
7
8
import logging
9
import os
10
import unittest
11
14578.4.4 by William Grant
format-imports.
12
from canonical.testing.layers import LaunchpadFunctionalLayer
14578.4.1 by William Grant
Move the remains of canonical.launchpad.testing to lp.testing.
13
from lp.testing.systemdocs import (
11403.1.4 by Henning Eggers
Reformatted imports using format-imports script r32.
14
    LayeredDocFileSuite,
15
    setUp,
16
    tearDown,
17
    )
8138.1.2 by Jonathan Lange
Run migrater over lp.code. Many tests broken and imports failing.
18
19
20
here = os.path.dirname(os.path.realpath(__file__))
21
22
23
def test_suite():
24
    suite = unittest.TestSuite()
25
    testsdir = os.path.abspath(here)
26
27
    # Add tests using default setup/teardown
28
    filenames = [filename
29
                 for filename in os.listdir(testsdir)
30
                 if filename.endswith('.txt')]
31
    # Sort the list to give a predictable order.
32
    filenames.sort()
33
    for filename in filenames:
34
        path = filename
35
        one_test = LayeredDocFileSuite(
36
            path, setUp=setUp, tearDown=tearDown,
37
            layer=LaunchpadFunctionalLayer,
38
            stdout_logging_level=logging.WARNING
39
            )
40
        suite.addTest(one_test)
41
42
    return suite