~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/migrater/test_views.py

  • Committer: Karl Fogel
  • Date: 2009-09-17 17:29:33 UTC
  • mto: This revision was merged to the branch mainline in revision 9497.
  • Revision ID: karl.fogel@canonical.com-20090917172933-xnd2vkd9is6y9te8
Add utilities/formatdoctest.py and utilities/migrater/, both brought
over from the old lp-dev-utils.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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