Mercurial > bitten > bitten-test
annotate bitten/tests/web_ui.py @ 593:99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
Closes #209.
author | osimons |
---|---|
date | Sun, 26 Jul 2009 13:36:15 +0000 |
parents | 9ae8f6a95d4b |
children | f3bb52da9e3c |
rev | line source |
---|---|
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
2 # |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
3 # Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de> |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
4 # Copyright (C) 2007 Edgewall Software |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
5 # All rights reserved. |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
6 # |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
7 # This software is licensed as described in the file COPYING, which |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
8 # you should have received as part of this distribution. The terms |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
9 # are also available at http://bitten.edgewall.org/wiki/License. |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
10 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
11 import shutil |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
12 import tempfile |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
13 import unittest |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
14 |
439 | 15 from trac.core import TracError |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
16 from trac.db import DatabaseManager |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
17 from trac.perm import PermissionCache, PermissionSystem |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
18 from trac.test import EnvironmentStub, Mock |
439 | 19 from trac.util.html import Markup |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
20 from trac.web.api import HTTPNotFound |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
21 from trac.web.href import Href |
439 | 22 from bitten.main import BuildSystem |
23 from bitten.model import Build, BuildConfig, BuildStep, TargetPlatform, schema | |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
24 from bitten.web_ui import BuildConfigController, BuildController, \ |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
25 SourceFileLinkFormatter |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
26 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
27 |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
28 class AbstractWebUITestCase(unittest.TestCase): |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
29 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
30 def setUp(self): |
458 | 31 self.env = EnvironmentStub(enable=['trac.*', 'bitten.*']) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
32 self.env.path = tempfile.mkdtemp() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
33 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
34 # Create tables |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
35 db = self.env.get_db_cnx() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
36 cursor = db.cursor() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
37 connector, _ = DatabaseManager(self.env)._get_connector() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
38 for table in schema: |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
39 for stmt in connector.to_sql(table): |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
40 cursor.execute(stmt) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
41 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
42 # Set up permissions |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
43 self.env.config.set('trac', 'permission_store', |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
44 'DefaultPermissionStore') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
45 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
46 # Hook up a dummy repository |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
47 self.repos = Mock( |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
48 get_node=lambda path, rev=None: Mock(get_history=lambda: [], |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
49 isdir=True), |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
50 normalize_path=lambda path: path, |
562
a8c84285e67a
Complete rights restrictions for build configs etc - see #384. Also enhance tests to work with this code (but don't yet check that rights are restricted properly)
dfraser
parents:
528
diff
changeset
|
51 sync=lambda: None, |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
52 ) |
562
a8c84285e67a
Complete rights restrictions for build configs etc - see #384. Also enhance tests to work with this code (but don't yet check that rights are restricted properly)
dfraser
parents:
528
diff
changeset
|
53 self.repos.authz = Mock(has_permission=lambda path: True, assert_permission=lambda path: None) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
54 self.env.get_repository = lambda authname=None: self.repos |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
55 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
56 def tearDown(self): |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
57 shutil.rmtree(self.env.path) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
58 |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
59 |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
60 class BuildConfigControllerTestCase(AbstractWebUITestCase): |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
61 |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
62 def test_overview(self): |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
63 PermissionSystem(self.env).grant_permission('joe', 'BUILD_VIEW') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
64 req = Mock(method='GET', base_path='', cgi_location='', |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
65 path_info='/build', href=Href('/trac'), args={}, chrome={}, |
562
a8c84285e67a
Complete rights restrictions for build configs etc - see #384. Also enhance tests to work with this code (but don't yet check that rights are restricted properly)
dfraser
parents:
528
diff
changeset
|
66 perm=PermissionCache(self.env, 'joe'), authname='joe') |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
67 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
68 module = BuildConfigController(self.env) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
69 assert module.match_request(req) |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
70 _, data, _ = module.process_request(req) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
71 |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
72 self.assertEqual('overview', data['page_mode']) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
73 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
74 def test_view_config(self): |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
75 config = BuildConfig(self.env, name='test', path='trunk') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
76 config.insert() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
77 platform = TargetPlatform(self.env, config='test', name='any') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
78 platform.insert() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
79 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
80 PermissionSystem(self.env).grant_permission('joe', 'BUILD_VIEW') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
81 req = Mock(method='GET', base_path='', cgi_location='', |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
82 path_info='/build/test', href=Href('/trac'), args={}, |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
83 chrome={}, authname='joe', |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
84 perm=PermissionCache(self.env, 'joe')) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
85 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
86 root = Mock(get_entries=lambda: ['foo'], |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
87 get_history=lambda: [('trunk', rev, 'edit') for rev in |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
88 range(123, 111, -1)]) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
89 self.repos = Mock(get_node=lambda path, rev=None: root, |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
90 sync=lambda: None, normalize_path=lambda path: path) |
562
a8c84285e67a
Complete rights restrictions for build configs etc - see #384. Also enhance tests to work with this code (but don't yet check that rights are restricted properly)
dfraser
parents:
528
diff
changeset
|
91 self.repos.authz = Mock(has_permission=lambda path: True, assert_permission=lambda path: None) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
92 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
93 module = BuildConfigController(self.env) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
94 assert module.match_request(req) |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
95 _, data, _ = module.process_request(req) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
96 |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
97 self.assertEqual('view_config', data['page_mode']) |
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
98 assert not 'next' in req.chrome['links'] |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
99 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
100 def test_view_config_paging(self): |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
101 config = BuildConfig(self.env, name='test', path='trunk') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
102 config.insert() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
103 platform = TargetPlatform(self.env, config='test', name='any') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
104 platform.insert() |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
105 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
106 PermissionSystem(self.env).grant_permission('joe', 'BUILD_VIEW') |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
107 req = Mock(method='GET', base_path='', cgi_location='', |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
108 path_info='/build/test', href=Href('/trac'), args={}, |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
109 chrome={}, authname='joe', |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
110 perm=PermissionCache(self.env, 'joe')) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
111 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
112 root = Mock(get_entries=lambda: ['foo'], |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
113 get_history=lambda: [('trunk', rev, 'edit') for rev in |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
114 range(123, 110, -1)]) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
115 self.repos = Mock(get_node=lambda path, rev=None: root, |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
116 sync=lambda: None, normalize_path=lambda path: path) |
562
a8c84285e67a
Complete rights restrictions for build configs etc - see #384. Also enhance tests to work with this code (but don't yet check that rights are restricted properly)
dfraser
parents:
528
diff
changeset
|
117 self.repos.authz = Mock(has_permission=lambda path: True, assert_permission=lambda path: None) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
118 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
119 module = BuildConfigController(self.env) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
120 assert module.match_request(req) |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
121 _, data, _ = module.process_request(req) |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
122 |
503
a7c795920c4a
Merging trac-0.11 branch to trunk. This revision is equivalent to [571].
wbell
parents:
458
diff
changeset
|
123 if req.chrome: |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
124 self.assertEqual('/trac/build/test?page=2', |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
125 req.chrome['links']['next'][0]['href']) |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
126 |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
127 def test_raise_404(self): |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
128 PermissionSystem(self.env).grant_permission('joe', 'BUILD_VIEW') |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
129 module = BuildConfigController(self.env) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
130 req = Mock(method='GET', base_path='', cgi_location='', |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
131 path_info='/build/nonexisting', href=Href('/trac'), args={}, |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
132 chrome={}, authname='joe', |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
133 perm=PermissionCache(self.env, 'joe')) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
134 self.failUnless(module.match_request(req)) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
135 try: |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
136 module.process_request(req) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
137 except Exception, e: |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
138 self.failUnless(isinstance(e, HTTPNotFound)) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
139 self.assertEquals(str(e), "404 Not Found (Build configuration " |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
140 "'nonexisting' does not exist.)") |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
141 return |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
142 self.fail("This should have raised HTTPNotFound") |
439 | 143 |
144 | |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
145 class BuildControllerTestCase(AbstractWebUITestCase): |
439 | 146 |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
147 def test_raise_404(self): |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
148 PermissionSystem(self.env).grant_permission('joe', 'BUILD_VIEW') |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
149 module = BuildController(self.env) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
150 config = BuildConfig(self.env, name='existing', path='trunk') |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
151 config.insert() |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
152 req = Mock(method='GET', base_path='', cgi_location='', |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
153 path_info='/build/existing/42', href=Href('/trac'), args={}, |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
154 chrome={}, authname='joe', |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
155 perm=PermissionCache(self.env, 'joe')) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
156 self.failUnless(module.match_request(req)) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
157 try: |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
158 module.process_request(req) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
159 except Exception, e: |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
160 self.failUnless(isinstance(e, HTTPNotFound)) |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
161 self.assertEquals(str(e), |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
162 "404 Not Found (Build '42' does not exist.)") |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
163 return |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
164 self.fail("This should have raised HTTPNotFound") |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
165 |
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
166 class SourceFileLinkFormatterTestCase(AbstractWebUITestCase): |
439 | 167 |
168 def test_format_simple_link_in_repos(self): | |
169 BuildConfig(self.env, name='test', path='trunk').insert() | |
170 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | |
171 status=Build.SUCCESS, slave='hal') | |
172 build.insert() | |
173 step = BuildStep(self.env, build=build.id, name='foo', | |
174 status=BuildStep.SUCCESS) | |
175 step.insert() | |
176 | |
177 self.repos.get_node = lambda path, rev: (path, rev) | |
178 | |
179 req = Mock(method='GET', href=Href('/trac'), authname='hal') | |
180 comp = SourceFileLinkFormatter(self.env) | |
181 formatter = comp.get_formatter(req, build) | |
182 | |
593
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
183 # posix |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
184 output = formatter(step, None, None, u'error in foo/bar.c: bad') |
439 | 185 self.assertEqual(Markup, type(output)) |
186 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c">' | |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
187 'foo/bar.c</a>: bad', output) |
593
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
188 # windows |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
189 output = formatter(step, None, None, u'error in foo\\win.c: bad') |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
190 self.assertEqual(Markup, type(output)) |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
191 self.assertEqual(r'error in <a href="/trac/browser/trunk/foo/win.c">' |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
192 'foo\win.c</a>: bad', output) |
439 | 193 |
528
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
194 def test_format_bad_links(self): |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
195 BuildConfig(self.env, name='test', path='trunk').insert() |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
196 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
197 status=Build.SUCCESS, slave='hal') |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
198 build.insert() |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
199 step = BuildStep(self.env, build=build.id, name='foo', |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
200 status=BuildStep.SUCCESS) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
201 step.insert() |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
202 |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
203 self.repos.get_node = lambda path, rev: (path, rev) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
204 |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
205 req = Mock(method='GET', href=Href('/trac'), authname='hal') |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
206 comp = SourceFileLinkFormatter(self.env) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
207 formatter = comp.get_formatter(req, build) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
208 |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
209 output = formatter(step, None, None, u'Linking -I../.. with ../libtool') |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
210 self.assertEqual(Markup, type(output)) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
211 self.assertEqual('Linking -I../.. with ../libtool', output) |
f3bf55de8a34
Prevent path highlighting from passing non-canonical paths to svn:
dfraser
parents:
503
diff
changeset
|
212 |
439 | 213 def test_format_simple_link_not_in_repos(self): |
214 BuildConfig(self.env, name='test', path='trunk').insert() | |
215 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | |
216 status=Build.SUCCESS, slave='hal') | |
217 build.insert() | |
218 step = BuildStep(self.env, build=build.id, name='foo', | |
219 status=BuildStep.SUCCESS) | |
220 step.insert() | |
221 | |
222 def _raise(): | |
223 raise TracError('No such node') | |
224 self.repos.get_node = lambda path, rev: _raise() | |
225 | |
226 req = Mock(method='GET', href=Href('/trac'), authname='hal') | |
227 comp = SourceFileLinkFormatter(self.env) | |
228 formatter = comp.get_formatter(req, build) | |
229 | |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
230 output = formatter(step, None, None, u'error in foo/bar.c: bad') |
439 | 231 self.assertEqual(Markup, type(output)) |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
232 self.assertEqual('error in foo/bar.c: bad', output) |
439 | 233 |
234 def test_format_link_in_repos_with_line(self): | |
235 BuildConfig(self.env, name='test', path='trunk').insert() | |
236 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | |
237 status=Build.SUCCESS, slave='hal') | |
238 build.insert() | |
239 step = BuildStep(self.env, build=build.id, name='foo', | |
240 status=BuildStep.SUCCESS) | |
241 step.insert() | |
242 | |
243 self.repos.get_node = lambda path, rev: (path, rev) | |
244 | |
245 req = Mock(method='GET', href=Href('/trac'), authname='hal') | |
246 comp = SourceFileLinkFormatter(self.env) | |
247 formatter = comp.get_formatter(req, build) | |
248 | |
593
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
249 # posix |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
250 output = formatter(step, None, None, u'error in foo/bar.c:123: bad') |
439 | 251 self.assertEqual(Markup, type(output)) |
252 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c#L123">' | |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
253 'foo/bar.c:123</a>: bad', output) |
593
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
254 # windows |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
255 output = formatter(step, None, None, u'error in foo\\win.c:123: bad') |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
256 self.assertEqual(Markup, type(output)) |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
257 self.assertEqual(r'error in <a href="/trac/browser/trunk/foo/win.c#L123">' |
99831ab37fd3
0.6dev: Making source-linking work also for Windows-style file references (as output by Windows slaves). Thanks to Doug Patterson for updated regexp.
osimons
parents:
575
diff
changeset
|
258 'foo\win.c:123</a>: bad', output) |
439 | 259 |
260 def test_format_link_not_in_repos_with_line(self): | |
261 BuildConfig(self.env, name='test', path='trunk').insert() | |
262 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | |
263 status=Build.SUCCESS, slave='hal') | |
264 build.insert() | |
265 step = BuildStep(self.env, build=build.id, name='foo', | |
266 status=BuildStep.SUCCESS) | |
267 step.insert() | |
268 | |
269 def _raise(): | |
270 raise TracError('No such node') | |
271 self.repos.get_node = lambda path, rev: _raise() | |
272 | |
273 req = Mock(method='GET', href=Href('/trac'), authname='hal') | |
274 comp = SourceFileLinkFormatter(self.env) | |
275 formatter = comp.get_formatter(req, build) | |
276 | |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
277 output = formatter(step, None, None, u'error in foo/bar.c:123: bad') |
439 | 278 self.assertEqual(Markup, type(output)) |
440
e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
cmlenz
parents:
439
diff
changeset
|
279 self.assertEqual('error in foo/bar.c:123: bad', output) |
439 | 280 |
281 | |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
282 def suite(): |
439 | 283 suite = unittest.TestSuite() |
284 suite.addTest(unittest.makeSuite(BuildConfigControllerTestCase, 'test')) | |
575
9ae8f6a95d4b
0.6dev: Adding tests for [645], and also reworked web_ui testcase classes to inherit from an abstract class that contains all the shared `setUp()` and `tearDown()` code.
osimons
parents:
562
diff
changeset
|
285 suite.addTest(unittest.makeSuite(BuildControllerTestCase, 'test')) |
439 | 286 suite.addTest(unittest.makeSuite(SourceFileLinkFormatterTestCase, 'test')) |
287 return suite | |
410
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
288 |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
289 if __name__ == '__main__': |
7930cdd83d13
More restructuring: got rid of the `trac_ext` subpackage, which makes no sense now that the master is also coupled to Trac.
cmlenz
parents:
diff
changeset
|
290 unittest.main(defaultTest='suite') |