Merge lp:~jml/launchpad/upcall-testcase into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/upcall-testcase
Merge into: lp:launchpad
Diff against target: 828 lines (+88/-47)
28 files modified
lib/canonical/config/tests/test_config_lookup.py (+7/-7)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py (+17/-12)
lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py (+3/-0)
lib/canonical/launchpad/scripts/tests/test_runlaunchpad.py (+2/-2)
lib/canonical/launchpad/webapp/tests/__init__.py (+2/-1)
lib/canonical/launchpad/webapp/tests/test_dbpolicy.py (+8/-5)
lib/canonical/launchpad/webapp/tests/test_menu.py (+1/-0)
lib/canonical/launchpad/webapp/tests/test_servers.py (+1/-2)
lib/lp/archiveuploader/tests/test_buildduploads.py (+2/-2)
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+1/-1)
lib/lp/archiveuploader/tests/test_securityuploads.py (+2/-2)
lib/lp/archiveuploader/tests/test_uploadprocessor.py (+2/-1)
lib/lp/code/browser/tests/test_branch.py (+4/-2)
lib/lp/code/mail/tests/test_codehandler.py (+9/-3)
lib/lp/code/model/tests/test_branch.py (+4/-1)
lib/lp/code/model/tests/test_codereviewkarma.py (+2/-1)
lib/lp/code/model/tests/test_revisionauthor.py (+3/-0)
lib/lp/codehosting/puller/tests/test_worker.py (+1/-0)
lib/lp/codehosting/tests/test_rewrite.py (+1/-1)
lib/lp/registry/tests/test_distroseries.py (+1/-0)
lib/lp/registry/tests/test_prf_walker.py (+3/-0)
lib/lp/scripts/utilities/tests/test_sanitizedb.py (+1/-0)
lib/lp/services/apachelogparser/tests/test_apachelogparser.py (+2/-0)
lib/lp/services/database/tests/test_prejoin.py (+1/-0)
lib/lp/services/mail/tests/test_mailbox.py (+2/-4)
lib/lp/services/memcache/tests/test_memcache_client.py (+1/-0)
lib/lp/soyuz/scripts/tests/test_copypackage.py (+1/-0)
lib/lp/translations/scripts/tests/test_remove_translations.py (+4/-0)
To merge this branch: bzr merge lp:~jml/launchpad/upcall-testcase
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+17002@code.launchpad.net

Commit message

Upcall setUp and tearDown everywhere, allowing use of testtools

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This branch is pretty simple in intent. It goes through many, many test cases and makes them upcall setUp and tearDown.

It's a prequisite for using testtools, which mandates upcalling setUp & tearDown to avoid more painful errors.

I've also changed a lot of the upcalls to be new-style.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

It looks fine. I worry slightly about doing super(...).setUp(argument), but only slightly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/config/tests/test_config_lookup.py'
--- lib/canonical/config/tests/test_config_lookup.py 2009-07-17 00:26:05 +0000
+++ lib/canonical/config/tests/test_config_lookup.py 2010-01-08 04:12:19 +0000
@@ -8,18 +8,17 @@
88
9import os9import os
10import shutil10import shutil
11from tempfile import mkdtemp, NamedTemporaryFile
11import unittest12import unittest
1213
13from tempfile import mkdtemp, NamedTemporaryFile
14from unittest import makeSuite, TestCase, TestSuite
15
16import lp.testing
17
18from canonical import config14from canonical import config
15from lp.testing import TestCase
16
1917
20class TestConfigLookup(TestCase):18class TestConfigLookup(TestCase):
2119
22 def setUp(self):20 def setUp(self):
21 super(TestConfigLookup, self).setUp()
23 self.temp_lookup_file = None22 self.temp_lookup_file = None
24 self.original_CONFIG_LOOKUP_FILES = config.CONFIG_LOOKUP_FILES23 self.original_CONFIG_LOOKUP_FILES = config.CONFIG_LOOKUP_FILES
25 self.original_LPCONFIG = os.environ['LPCONFIG']24 self.original_LPCONFIG = os.environ['LPCONFIG']
@@ -28,6 +27,7 @@
28 del self.temp_lookup_file27 del self.temp_lookup_file
29 config.CONFIG_LOOKUP_FILES = self.original_CONFIG_LOOKUP_FILES28 config.CONFIG_LOOKUP_FILES = self.original_CONFIG_LOOKUP_FILES
30 os.environ['LPCONFIG'] = self.original_LPCONFIG29 os.environ['LPCONFIG'] = self.original_LPCONFIG
30 super(TestConfigLookup, self).tearDown()
3131
32 def makeLookupFile(self):32 def makeLookupFile(self):
33 self.temp_lookup_file = NamedTemporaryFile()33 self.temp_lookup_file = NamedTemporaryFile()
@@ -61,7 +61,7 @@
61 config.find_instance_name(), config.DEFAULT_CONFIG)61 config.find_instance_name(), config.DEFAULT_CONFIG)
6262
6363
64class ConfigTestCase(lp.testing.TestCase):64class ConfigTestCase(TestCase):
65 """Base test case that provides fixtures for testing configuration.65 """Base test case that provides fixtures for testing configuration.
66 """66 """
6767
@@ -79,7 +79,6 @@
79 shutil.rmtree(self.temp_config_root_dir)79 shutil.rmtree(self.temp_config_root_dir)
80 config.CONFIG_ROOT_DIRS = self.original_root_dirs80 config.CONFIG_ROOT_DIRS = self.original_root_dirs
8181
82
83 def setUpInstanceConfig(self, instance_name):82 def setUpInstanceConfig(self, instance_name):
84 """Create an instance directory with empty config files.83 """Create an instance directory with empty config files.
8584
@@ -104,6 +103,7 @@
104 """Test where instance config directories are looked up."""103 """Test where instance config directories are looked up."""
105104
106 def setUp(self):105 def setUp(self):
106 super(TestInstanceConfigDirLookup, self).setUp()
107 self.setUpConfigRoots()107 self.setUpConfigRoots()
108108
109 def test_find_config_dir_raises_ValueError(self):109 def test_find_config_dir_raises_ValueError(self):
110110
=== modified file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py'
--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2009-10-27 14:36:03 +0000
+++ lib/canonical/launchpad/scripts/tests/test_hwdb_submission_parser.py 2010-01-08 04:12:19 +0000
@@ -25,12 +25,14 @@
2525
26from lp.testing import TestCase, validate_mock_class26from lp.testing import TestCase, validate_mock_class
2727
28
28class SubmissionParserTestParseSoftware(SubmissionParser):29class SubmissionParserTestParseSoftware(SubmissionParser):
29 """A Variant used to test SubmissionParser._parseSoftware.30 """A Variant used to test SubmissionParser._parseSoftware.
3031
31 This class can be used to test the regular case of32 This class can be used to test the regular case of
32 submission data.33 submission data.
33 """34 """
35
34 def __init__(self, test, logger=None):36 def __init__(self, test, logger=None):
35 super(SubmissionParserTestParseSoftware, self).__init__(logger)37 super(SubmissionParserTestParseSoftware, self).__init__(logger)
36 self.test = test38 self.test = test
@@ -54,6 +56,7 @@
54 This class is intended to test submission data that does not contain56 This class is intended to test submission data that does not contain
55 a <xorg> node.57 a <xorg> node.
56 """58 """
59
57 def __init__(self, test, logger=None):60 def __init__(self, test, logger=None):
58 super(SubmissionParserTestParseSoftwareNoXorgNode, self).__init__(61 super(SubmissionParserTestParseSoftwareNoXorgNode, self).__init__(
59 logger)62 logger)
@@ -74,6 +77,7 @@
74 This class is intended to test submission data that does not contain77 This class is intended to test submission data that does not contain
75 a <packages> node.78 a <packages> node.
76 """79 """
80
77 def __init__(self, test, logger=None):81 def __init__(self, test, logger=None):
78 super(SubmissionParserTestParseSoftwareNoPackagesNode, self).__init__(82 super(SubmissionParserTestParseSoftwareNoPackagesNode, self).__init__(
79 logger)83 logger)
@@ -95,6 +99,7 @@
9599
96 def setUp(self):100 def setUp(self):
97 """Setup the test environment."""101 """Setup the test environment."""
102 super(TestHWDBSubmissionParser, self).setUp()
98 self.log = logging.getLogger('test_hwdb_submission_parser')103 self.log = logging.getLogger('test_hwdb_submission_parser')
99 self.log.setLevel(logging.INFO)104 self.log.setLevel(logging.INFO)
100 self.handler = Handler(self)105 self.handler = Handler(self)
@@ -250,7 +255,7 @@
250 {'name': 'architecture_info',255 {'name': 'architecture_info',
251 'version': '1.1'},256 'version': '1.1'},
252 {'name': 'find_network_controllers',257 {'name': 'find_network_controllers',
253 'version': '2.34'}]}258 'version': '2.34'}]},
254 }259 }
255 self.assertEqual(260 self.assertEqual(
256 summary, expected_data,261 summary, expected_data,
@@ -293,7 +298,7 @@
293 'plugins': [298 'plugins': [
294 {299 {
295 'name': 'architecture_info',300 'name': 'architecture_info',
296 'version': '1.1'301 'version': '1.1',
297 },302 },
298 {303 {
299 'name': 'find_network_controllers',304 'name': 'find_network_controllers',
@@ -484,7 +489,6 @@
484 """)489 """)
485 self.assertRaises(ValueError, parser._parseProperties, node)490 self.assertRaises(ValueError, parser._parseProperties, node)
486491
487
488 def testDevice(self):492 def testDevice(self):
489 """A device node is converted into a dictionary."""493 """A device node is converted into a dictionary."""
490 test = self494 test = self
@@ -919,6 +923,7 @@
919923
920 All "method substitutes" return a valid result.924 All "method substitutes" return a valid result.
921 """925 """
926
922 def __init__(self, logger=None):927 def __init__(self, logger=None):
923 super(self.__class__, self).__init__(logger)928 super(self.__class__, self).__init__(logger)
924 self.hal_result = 'parsed HAL data'929 self.hal_result = 'parsed HAL data'
@@ -1312,6 +1317,7 @@
13121317
1313 All "method substitutes" return a valid result.1318 All "method substitutes" return a valid result.
1314 """1319 """
1320
1315 def __init__(self, logger=None):1321 def __init__(self, logger=None):
1316 SubmissionParser.__init__(self, logger)1322 SubmissionParser.__init__(self, logger)
1317 self.summary_result = 'parsed summary'1323 self.summary_result = 'parsed summary'
@@ -1363,8 +1369,8 @@
1363 'summary': 'parsed summary',1369 'summary': 'parsed summary',
1364 'hardware': 'parsed hardware',1370 'hardware': 'parsed hardware',
1365 'software': 'parsed software',1371 'software': 'parsed software',
1366 'questions': 'parsed questions',1372 'questions': 'parsed questions',
1367 'context': 'parsed context',1373 'context': 'parsed context',
1368 }1374 }
13691375
1370 result = parser.parseMainSections(node)1376 result = parser.parseMainSections(node)
@@ -1550,7 +1556,7 @@
1550 'hardware': {1556 'hardware': {
1551 'udev': udev,1557 'udev': udev,
1552 'sysfs-attributes': sysfs_attributes,1558 'sysfs-attributes': sysfs_attributes,
1553 'processors': processors1559 'processors': processors,
1554 },1560 },
1555 'software': {1561 'software': {
1556 'packages': packages1562 'packages': packages
@@ -1579,7 +1585,7 @@
1579 ]1585 ]
1580 processors = [1586 processors = [
1581 {'id': 1},1587 {'id': 1},
1582 {'id': 2}1588 {'id': 2},
1583 ]1589 ]
1584 packages = {1590 packages = {
1585 'bzr': {'id': 4},1591 'bzr': {'id': 4},
@@ -1589,7 +1595,7 @@
1589 'hardware': {1595 'hardware': {
1590 'udev': udev,1596 'udev': udev,
1591 'sysfs-attributes': sysfs_attributes,1597 'sysfs-attributes': sysfs_attributes,
1592 'processors': processors1598 'processors': processors,
1593 },1599 },
1594 'software': {1600 'software': {
1595 'packages': packages1601 'packages': packages
@@ -1646,7 +1652,7 @@
1646 submission = {1652 submission = {
1647 'hardware': {1653 'hardware': {
1648 'udev': devices,1654 'udev': devices,
1649 'processors': processors1655 'processors': processors,
1650 },1656 },
1651 'software': {1657 'software': {
1652 'packages': packages1658 'packages': packages
@@ -1707,8 +1713,7 @@
1707 {'udi': DEVICE_2_UDI,1713 {'udi': DEVICE_2_UDI,
1708 'properties': {1714 'properties': {
1709 'info.parent': (ROOT_UDI,1715 'info.parent': (ROOT_UDI,
1710 'dbus.String')}1716 'dbus.String')}}]
1711 }]
17121717
1713 def testUDIDeviceMap(self):1718 def testUDIDeviceMap(self):
1714 """Test the creation of the mapping UDI -> device."""1719 """Test the creation of the mapping UDI -> device."""
@@ -1893,7 +1898,7 @@
1893 'properties':1898 'properties':
1894 {'info.parent':1899 {'info.parent':
1895 (self.CIRCULAR_UDI_1, 'str')}}1900 (self.CIRCULAR_UDI_1, 'str')}}
1896 devices = [device1, device2, circular_device1, circular_device2]1901 devices = [device1, device2, circular_device1, circular_device2]
1897 parser = SubmissionParser()1902 parser = SubmissionParser()
1898 udi_device_map = parser.getUDIDeviceMap(devices)1903 udi_device_map = parser.getUDIDeviceMap(devices)
1899 udi_children = parser.getUDIChildren(udi_device_map)1904 udi_children = parser.getUDIChildren(udi_device_map)
19001905
=== modified file 'lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py'
--- lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py 2009-11-05 15:12:46 +0000
+++ lib/canonical/launchpad/scripts/tests/test_hwdb_submission_processing.py 2010-01-08 04:12:19 +0000
@@ -34,6 +34,7 @@
3434
35from lp.testing import TestCase, validate_mock_class35from lp.testing import TestCase, validate_mock_class
3636
37
37class TestCaseHWDB(TestCase):38class TestCaseHWDB(TestCase):
38 """Common base class for HWDB processing tests."""39 """Common base class for HWDB processing tests."""
3940
@@ -91,6 +92,7 @@
9192
92 def setUp(self):93 def setUp(self):
93 """Setup the test environment."""94 """Setup the test environment."""
95 super(TestCaseHWDB, self).setUp()
94 self.log = logging.getLogger('test_hwdb_submission_parser')96 self.log = logging.getLogger('test_hwdb_submission_parser')
95 self.log.setLevel(logging.INFO)97 self.log.setLevel(logging.INFO)
96 self.handler = Handler(self)98 self.handler = Handler(self)
@@ -4534,6 +4536,7 @@
45344536
4535 def setUp(self):4537 def setUp(self):
4536 """Setup the test environment."""4538 """Setup the test environment."""
4539 super(TestHWDBSubmissionTablePopulation, self).setUp()
4537 self.log = logging.getLogger('test_hwdb_submission_parser')4540 self.log = logging.getLogger('test_hwdb_submission_parser')
4538 self.log.setLevel(logging.INFO)4541 self.log.setLevel(logging.INFO)
4539 self.handler = Handler(self)4542 self.handler = Handler(self)
45404543
=== modified file 'lib/canonical/launchpad/scripts/tests/test_runlaunchpad.py'
--- lib/canonical/launchpad/scripts/tests/test_runlaunchpad.py 2009-08-12 19:07:45 +0000
+++ lib/canonical/launchpad/scripts/tests/test_runlaunchpad.py 2010-01-08 04:12:19 +0000
@@ -6,7 +6,7 @@
6__metaclass__ = type6__metaclass__ = type
7__all__ = [7__all__ = [
8 'CommandLineArgumentProcessing',8 'CommandLineArgumentProcessing',
9 'ServersToStart'9 'ServersToStart',
10 ]10 ]
1111
1212
@@ -68,11 +68,11 @@
68 split_out_runlaunchpad_arguments(['-o', 'foo', '--bar=baz']))68 split_out_runlaunchpad_arguments(['-o', 'foo', '--bar=baz']))
6969
7070
71
72class TestDefaultConfigArgument(lp.testing.TestCase):71class TestDefaultConfigArgument(lp.testing.TestCase):
73 """Tests for the processing of the -C argument."""72 """Tests for the processing of the -C argument."""
7473
75 def setUp(self):74 def setUp(self):
75 super(TestDefaultConfigArgument, self).setUp()
76 self.config_root = tempfile.mkdtemp('configs')76 self.config_root = tempfile.mkdtemp('configs')
77 self.saved_instance = config.instance_name77 self.saved_instance = config.instance_name
78 self.saved_config_roots = canonical.config.CONFIG_ROOT_DIRS78 self.saved_config_roots = canonical.config.CONFIG_ROOT_DIRS
7979
=== modified file 'lib/canonical/launchpad/webapp/tests/__init__.py'
--- lib/canonical/launchpad/webapp/tests/__init__.py 2009-08-20 13:32:32 +0000
+++ lib/canonical/launchpad/webapp/tests/__init__.py 2010-01-08 04:12:19 +0000
@@ -21,10 +21,11 @@
21 """A test case that installs a DummyWebServiceConfiguration."""21 """A test case that installs a DummyWebServiceConfiguration."""
2222
23 def setUp(self):23 def setUp(self):
24 super(DummyConfigurationTestCase, self).setUp()
24 self.config = DummyWebServiceConfiguration()25 self.config = DummyWebServiceConfiguration()
25 provideUtility(self.config, IWebServiceConfiguration)26 provideUtility(self.config, IWebServiceConfiguration)
2627
27 def tearDown(self):28 def tearDown(self):
28 getGlobalSiteManager().unregisterUtility(29 getGlobalSiteManager().unregisterUtility(
29 self.config, IWebServiceConfiguration)30 self.config, IWebServiceConfiguration)
3031 super(DummyConfigurationTestCase, self).tearDown()
3132
=== modified file 'lib/canonical/launchpad/webapp/tests/test_dbpolicy.py'
--- lib/canonical/launchpad/webapp/tests/test_dbpolicy.py 2009-10-13 05:48:15 +0000
+++ lib/canonical/launchpad/webapp/tests/test_dbpolicy.py 2010-01-08 04:12:19 +0000
@@ -60,12 +60,14 @@
60 policy = None60 policy = None
6161
62 def setUp(self):62 def setUp(self):
63 super(BaseDatabasePolicyTestCase, self).setUp()
63 if self.policy is None:64 if self.policy is None:
64 self.policy = BaseDatabasePolicy()65 self.policy = BaseDatabasePolicy()
65 getUtility(IStoreSelector).push(self.policy)66 getUtility(IStoreSelector).push(self.policy)
6667
67 def tearDown(self):68 def tearDown(self):
68 getUtility(IStoreSelector).pop()69 getUtility(IStoreSelector).pop()
70 super(BaseDatabasePolicyTestCase, self).tearDown()
6971
70 def test_correctly_implements_IDatabasePolicy(self):72 def test_correctly_implements_IDatabasePolicy(self):
71 self.assertProvides(self.policy, IDatabasePolicy)73 self.assertProvides(self.policy, IDatabasePolicy)
@@ -77,7 +79,7 @@
77 def setUp(self):79 def setUp(self):
78 if self.policy is None:80 if self.policy is None:
79 self.policy = SlaveDatabasePolicy()81 self.policy = SlaveDatabasePolicy()
80 BaseDatabasePolicyTestCase.setUp(self)82 super(SlaveDatabasePolicyTestCase, self).setUp()
8183
82 def test_defaults(self):84 def test_defaults(self):
83 for store in ALL_STORES:85 for store in ALL_STORES:
@@ -97,7 +99,7 @@
9799
98 def setUp(self):100 def setUp(self):
99 self.policy = SlaveOnlyDatabasePolicy()101 self.policy = SlaveOnlyDatabasePolicy()
100 BaseDatabasePolicyTestCase.setUp(self)102 super(SlaveOnlyDatabasePolicyTestCase, self).setUp()
101103
102 def test_master_allowed(self):104 def test_master_allowed(self):
103 for store in ALL_STORES:105 for store in ALL_STORES:
@@ -111,7 +113,7 @@
111113
112 def setUp(self):114 def setUp(self):
113 self.policy = MasterDatabasePolicy()115 self.policy = MasterDatabasePolicy()
114 BaseDatabasePolicyTestCase.setUp(self)116 super(MasterDatabasePolicyTestCase, self).setUp()
115117
116 def test_XMLRPCRequest_uses_MasterPolicy(self):118 def test_XMLRPCRequest_uses_MasterPolicy(self):
117 """XMLRPC should always use the master flavor, since they always119 """XMLRPC should always use the master flavor, since they always
@@ -139,10 +141,11 @@
139 This test just checks the defaults, which is the same as the141 This test just checks the defaults, which is the same as the
140 slave policy for unauthenticated requests.142 slave policy for unauthenticated requests.
141 """143 """
144
142 def setUp(self):145 def setUp(self):
143 request = LaunchpadTestRequest(SERVER_URL='http://launchpad.dev')146 request = LaunchpadTestRequest(SERVER_URL='http://launchpad.dev')
144 self.policy = LaunchpadDatabasePolicy(request)147 self.policy = LaunchpadDatabasePolicy(request)
145 SlaveDatabasePolicyTestCase.setUp(self)148 super(LaunchpadDatabasePolicyTestCase, self).setUp()
146149
147150
148class LayerDatabasePolicyTestCase(TestCase):151class LayerDatabasePolicyTestCase(TestCase):
@@ -243,7 +246,7 @@
243246
244 def setUp(self):247 def setUp(self):
245 self.policy = ReadOnlyLaunchpadDatabasePolicy()248 self.policy = ReadOnlyLaunchpadDatabasePolicy()
246 BaseDatabasePolicyTestCase.setUp(self)249 super(ReadOnlyLaunchpadDatabasePolicyTestCase, self).setUp()
247250
248 def test_defaults(self):251 def test_defaults(self):
249 # default Store is the slave.252 # default Store is the slave.
250253
=== modified file 'lib/canonical/launchpad/webapp/tests/test_menu.py'
--- lib/canonical/launchpad/webapp/tests/test_menu.py 2009-08-05 17:19:14 +0000
+++ lib/canonical/launchpad/webapp/tests/test_menu.py 2010-01-08 04:12:19 +0000
@@ -36,6 +36,7 @@
3636
37 def tearDown(self):37 def tearDown(self):
38 logout()38 logout()
39 super(TestMenuBaseLinkCaching, self).tearDown()
3940
40 def test_no_cache_when_there_is_no_request(self):41 def test_no_cache_when_there_is_no_request(self):
41 # Calling login() would cause a new interaction to be setup with a42 # Calling login() would cause a new interaction to be setup with a
4243
=== modified file 'lib/canonical/launchpad/webapp/tests/test_servers.py'
--- lib/canonical/launchpad/webapp/tests/test_servers.py 2009-09-17 14:23:16 +0000
+++ lib/canonical/launchpad/webapp/tests/test_servers.py 2010-01-08 04:12:19 +0000
@@ -418,7 +418,7 @@
418 {'QUERY_STRING': "a=1&b=2&c=3", 'REQUEST_METHOD': 'POST'})418 {'QUERY_STRING': "a=1&b=2&c=3", 'REQUEST_METHOD': 'POST'})
419 self.assertEqual(request.method, 'POST')419 self.assertEqual(request.method, 'POST')
420 self.assertEqual(420 self.assertEqual(
421 {'a':['1'], 'b': ['2'], 'c': ['3']},421 {'a': ['1'], 'b': ['2'], 'c': ['3']},
422 request.query_string_params,422 request.query_string_params,
423 "The query_string_params dict is populated from the "423 "The query_string_params dict is populated from the "
424 "QUERY_STRING during POST requests.")424 "QUERY_STRING during POST requests.")
@@ -461,4 +461,3 @@
461 optionflags=NORMALIZE_WHITESPACE | ELLIPSIS))461 optionflags=NORMALIZE_WHITESPACE | ELLIPSIS))
462 suite.addTest(unittest.TestLoader().loadTestsFromName(__name__))462 suite.addTest(unittest.TestLoader().loadTestsFromName(__name__))
463 return suite463 return suite
464
465464
=== modified file 'lib/lp/archiveuploader/tests/test_buildduploads.py'
--- lib/lp/archiveuploader/tests/test_buildduploads.py 2009-08-28 07:34:44 +0000
+++ lib/lp/archiveuploader/tests/test_buildduploads.py 2010-01-08 04:12:19 +0000
@@ -70,7 +70,7 @@
7070
71 real_policy = self.policy71 real_policy = self.policy
72 self.policy = 'insecure'72 self.policy = 'insecure'
73 TestStagedBinaryUploadBase.setUp(self)73 super(TestBuilddUploads, self).setUp()
74 self.policy = real_policy74 self.policy = real_policy
7575
76 def _publishBuildQueueItem(self, queue_item):76 def _publishBuildQueueItem(self, queue_item):
@@ -125,6 +125,6 @@
125 build_used.title)125 build_used.title)
126 self.assertEqual('FULLYBUILT', build_used.buildstate.name)126 self.assertEqual('FULLYBUILT', build_used.buildstate.name)
127127
128
128def test_suite():129def test_suite():
129 return unittest.TestLoader().loadTestsFromName(__name__)130 return unittest.TestLoader().loadTestsFromName(__name__)
130
131131
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2009-11-18 02:58:23 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2010-01-08 04:12:19 +0000
@@ -50,7 +50,7 @@
50 Additionally to the TestUploadProcessorBase.setUp, set 'breezy'50 Additionally to the TestUploadProcessorBase.setUp, set 'breezy'
51 distroseries and an new uploadprocessor instance.51 distroseries and an new uploadprocessor instance.
52 """52 """
53 TestUploadProcessorBase.setUp(self)53 super(TestPPAUploadProcessorBase, self).setUp()
54 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')54 self.ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
55 # Let's make 'name16' person member of 'launchpad-beta-tester'55 # Let's make 'name16' person member of 'launchpad-beta-tester'
56 # team only in the context of this test.56 # team only in the context of this test.
5757
=== modified file 'lib/lp/archiveuploader/tests/test_securityuploads.py'
--- lib/lp/archiveuploader/tests/test_securityuploads.py 2009-08-28 07:34:44 +0000
+++ lib/lp/archiveuploader/tests/test_securityuploads.py 2010-01-08 04:12:19 +0000
@@ -67,7 +67,7 @@
67 6. Clean log messages.67 6. Clean log messages.
68 7. Commit transaction, so the upload source can be seen.68 7. Commit transaction, so the upload source can be seen.
69 """69 """
70 TestUploadProcessorBase.setUp(self)70 super(TestStagedBinaryUploadBase, self).setUp()
71 self.options.context = self.policy71 self.options.context = self.policy
72 self.options.nomails = self.no_mails72 self.options.nomails = self.no_mails
73 # Set up the uploadprocessor with appropriate options and logger73 # Set up the uploadprocessor with appropriate options and logger
@@ -164,7 +164,7 @@
164164
165 def setUp(self):165 def setUp(self):
166 """Setup base class and create the required new distroarchseries."""166 """Setup base class and create the required new distroarchseries."""
167 TestStagedBinaryUploadBase.setUp(self)167 super(TestStagedSecurityUploads, self).setUp()
168 distribution = getUtility(IDistributionSet).getByName(168 distribution = getUtility(IDistributionSet).getByName(
169 self.distribution_name)169 self.distribution_name)
170 distroseries = distribution[self.distroseries.name]170 distroseries = distribution[self.distroseries.name]
171171
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2009-11-18 02:58:23 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2010-01-08 04:12:19 +0000
@@ -107,7 +107,7 @@
107 layer = LaunchpadZopelessLayer107 layer = LaunchpadZopelessLayer
108108
109 def setUp(self):109 def setUp(self):
110 TestCaseWithFactory.setUp(self)110 super(TestUploadProcessorBase, self).setUp()
111111
112 self.queue_folder = tempfile.mkdtemp()112 self.queue_folder = tempfile.mkdtemp()
113 os.makedirs(os.path.join(self.queue_folder, "incoming"))113 os.makedirs(os.path.join(self.queue_folder, "incoming"))
@@ -134,6 +134,7 @@
134134
135 def tearDown(self):135 def tearDown(self):
136 shutil.rmtree(self.queue_folder)136 shutil.rmtree(self.queue_folder)
137 super(TestUploadProcessorBase, self).tearDown()
137138
138 def assertLogContains(self, line):139 def assertLogContains(self, line):
139 """Assert if a given line is present in the log messages."""140 """Assert if a given line is present in the log messages."""
140141
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2009-11-13 21:16:15 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2010-01-08 04:12:19 +0000
@@ -119,12 +119,13 @@
119 layer = LaunchpadFunctionalLayer119 layer = LaunchpadFunctionalLayer
120120
121 def setUp(self):121 def setUp(self):
122 TestCaseWithFactory.setUp(self)122 super(TestBranchView, self).setUp()
123 login(ANONYMOUS)123 login(ANONYMOUS)
124 self.request = LaunchpadTestRequest()124 self.request = LaunchpadTestRequest()
125125
126 def tearDown(self):126 def tearDown(self):
127 logout()127 logout()
128 super(TestBranchView, self).tearDown()
128129
129 def testMirrorStatusMessageIsTruncated(self):130 def testMirrorStatusMessageIsTruncated(self):
130 """mirror_status_message is truncated if the text is overly long."""131 """mirror_status_message is truncated if the text is overly long."""
@@ -238,13 +239,14 @@
238 layer = DatabaseFunctionalLayer239 layer = DatabaseFunctionalLayer
239240
240 def setUp(self):241 def setUp(self):
241 TestCaseWithFactory.setUp(self)242 super(TestBranchAddView, self).setUp()
242 self.person = self.factory.makePerson()243 self.person = self.factory.makePerson()
243 login_person(self.person)244 login_person(self.person)
244 self.request = LaunchpadTestRequest()245 self.request = LaunchpadTestRequest()
245246
246 def tearDown(self):247 def tearDown(self):
247 logout()248 logout()
249 super(TestBranchAddView, self).tearDown()
248250
249 def get_view(self, context):251 def get_view(self, context):
250 view = BranchAddView(context, self.request)252 view = BranchAddView(context, self.request)
251253
=== modified file 'lib/lp/code/mail/tests/test_codehandler.py'
--- lib/lp/code/mail/tests/test_codehandler.py 2009-10-23 19:33:09 +0000
+++ lib/lp/code/mail/tests/test_codehandler.py 2010-01-08 04:12:19 +0000
@@ -127,12 +127,13 @@
127 layer = ZopelessAppServerLayer127 layer = ZopelessAppServerLayer
128128
129 def setUp(self):129 def setUp(self):
130 TestCaseWithFactory.setUp(self, user='test@canonical.com')130 super(TestCodeHandler, self).setUp(user='test@canonical.com')
131 self.code_handler = CodeHandler()131 self.code_handler = CodeHandler()
132 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)132 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)
133133
134 def tearDown(self):134 def tearDown(self):
135 setSecurityPolicy(self._old_policy)135 setSecurityPolicy(self._old_policy)
136 super(TestCodeHandler, self).tearDown()
136137
137 def switchDbUser(self, user):138 def switchDbUser(self, user):
138 """Commit the transactionand switch to the new user."""139 """Commit the transactionand switch to the new user."""
@@ -1060,6 +1061,7 @@
1060 # We don't need no stinking layer.1061 # We don't need no stinking layer.
10611062
1062 def setUp(self):1063 def setUp(self):
1064 super(TestVoteEmailCommand, self).setUp()
1063 class FakeExecutionContext:1065 class FakeExecutionContext:
1064 vote = None1066 vote = None
1065 vote_tags = None1067 vote_tags = None
@@ -1149,7 +1151,8 @@
1149 layer = LaunchpadZopelessLayer1151 layer = LaunchpadZopelessLayer
11501152
1151 def setUp(self):1153 def setUp(self):
1152 TestCaseWithFactory.setUp(self, user='test@canonical.com')1154 super(TestUpdateStatusEmailCommand, self).setUp(
1155 user='test@canonical.com')
1153 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)1156 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)
1154 self.merge_proposal = self.factory.makeBranchMergeProposal()1157 self.merge_proposal = self.factory.makeBranchMergeProposal()
1155 # Default the user to be the target branch owner, so they are1158 # Default the user to be the target branch owner, so they are
@@ -1161,6 +1164,7 @@
11611164
1162 def tearDown(self):1165 def tearDown(self):
1163 setSecurityPolicy(self._old_policy)1166 setSecurityPolicy(self._old_policy)
1167 super(TestUpdateStatusEmailCommand, self).tearDown()
11641168
1165 def test_numberOfArguments(self):1169 def test_numberOfArguments(self):
1166 # The command needs one and only one arg.1170 # The command needs one and only one arg.
@@ -1257,7 +1261,8 @@
1257 layer = LaunchpadZopelessLayer1261 layer = LaunchpadZopelessLayer
12581262
1259 def setUp(self):1263 def setUp(self):
1260 TestCaseWithFactory.setUp(self, user='test@canonical.com')1264 super(TestAddReviewerEmailCommand, self).setUp(
1265 user='test@canonical.com')
1261 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)1266 self._old_policy = setSecurityPolicy(LaunchpadSecurityPolicy)
1262 self.merge_proposal = self.factory.makeBranchMergeProposal()1267 self.merge_proposal = self.factory.makeBranchMergeProposal()
1263 # Default the user to be the target branch owner, so they are1268 # Default the user to be the target branch owner, so they are
@@ -1270,6 +1275,7 @@
12701275
1271 def tearDown(self):1276 def tearDown(self):
1272 setSecurityPolicy(self._old_policy)1277 setSecurityPolicy(self._old_policy)
1278 super(TestAddReviewerEmailCommand, self).tearDown()
12731279
1274 def test_numberOfArguments(self):1280 def test_numberOfArguments(self):
1275 # The command needs at least one arg.1281 # The command needs at least one arg.
12761282
=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py 2009-12-11 00:56:16 +0000
+++ lib/lp/code/model/tests/test_branch.py 2010-01-08 04:12:19 +0000
@@ -75,6 +75,7 @@
75 layer = LaunchpadZopelessLayer75 layer = LaunchpadZopelessLayer
7676
77 def setUp(self):77 def setUp(self):
78 super(TestCodeImport, self).setUp()
78 login('test@canonical.com')79 login('test@canonical.com')
79 self.factory = LaunchpadObjectFactory()80 self.factory = LaunchpadObjectFactory()
8081
@@ -650,6 +651,7 @@
650 layer = LaunchpadZopelessLayer651 layer = LaunchpadZopelessLayer
651652
652 def setUp(self):653 def setUp(self):
654 super(TestBranchDeletionConsequences, self).setUp()
653 login('test@canonical.com')655 login('test@canonical.com')
654 self.factory = LaunchpadObjectFactory()656 self.factory = LaunchpadObjectFactory()
655 # Has to be a product branch because of merge proposals.657 # Has to be a product branch because of merge proposals.
@@ -1035,7 +1037,7 @@
1035 layer = DatabaseFunctionalLayer1037 layer = DatabaseFunctionalLayer
10361038
1037 def setUp(self):1039 def setUp(self):
1038 TestCaseWithFactory.setUp(self, 'admin@canonical.com')1040 super(BranchAddLandingTarget, self).setUp('admin@canonical.com')
1039 self.product = self.factory.makeProduct()1041 self.product = self.factory.makeProduct()
10401042
1041 self.user = self.factory.makePerson()1043 self.user = self.factory.makePerson()
@@ -1048,6 +1050,7 @@
10481050
1049 def tearDown(self):1051 def tearDown(self):
1050 logout()1052 logout()
1053 super(BranchAddLandingTarget, self).tearDown()
10511054
1052 def test_junkSource(self):1055 def test_junkSource(self):
1053 """Junk branches cannot be used as a source for merge proposals."""1056 """Junk branches cannot be used as a source for merge proposals."""
10541057
=== modified file 'lib/lp/code/model/tests/test_codereviewkarma.py'
--- lib/lp/code/model/tests/test_codereviewkarma.py 2009-06-25 04:06:00 +0000
+++ lib/lp/code/model/tests/test_codereviewkarma.py 2010-01-08 04:12:19 +0000
@@ -29,7 +29,7 @@
29 def setUp(self):29 def setUp(self):
30 # Use an admin to get launchpad.Edit on all the branches to easily30 # Use an admin to get launchpad.Edit on all the branches to easily
31 # approve and reject the proposals.31 # approve and reject the proposals.
32 TestCaseWithFactory.setUp(self, 'admin@canonical.com')32 super(TestCodeReviewKarma, self).setUp('admin@canonical.com')
33 # The way the zope infrastructure works is that we can register33 # The way the zope infrastructure works is that we can register
34 # subscribers easily, but there is no way to unregister them (bug34 # subscribers easily, but there is no way to unregister them (bug
35 # 2338). TestEventListener does this with by setting a property to35 # 2338). TestEventListener does this with by setting a property to
@@ -46,6 +46,7 @@
4646
47 def tearDown(self):47 def tearDown(self):
48 self.karma_listener.unregister()48 self.karma_listener.unregister()
49 super(TestCodeReviewKarma, self).tearDown()
4950
50 def _on_karma_assigned(self, object, event):51 def _on_karma_assigned(self, object, event):
51 # Store the karma event for checking in the test method.52 # Store the karma event for checking in the test method.
5253
=== modified file 'lib/lp/code/model/tests/test_revisionauthor.py'
--- lib/lp/code/model/tests/test_revisionauthor.py 2009-06-25 04:06:00 +0000
+++ lib/lp/code/model/tests/test_revisionauthor.py 2010-01-08 04:12:19 +0000
@@ -33,6 +33,7 @@
33 layer = LaunchpadZopelessLayer33 layer = LaunchpadZopelessLayer
3434
35 def setUp(self):35 def setUp(self):
36 super(TestRevisionEmailExtraction, self).setUp()
36 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)37 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
3738
38 def test_email_extracted_from_name(self):39 def test_email_extracted_from_name(self):
@@ -132,6 +133,7 @@
132133
133 def setUp(self):134 def setUp(self):
134 # Create a revision author that doesn't have a user yet.135 # Create a revision author that doesn't have a user yet.
136 super(TestNewlyValidatedEmailsLinkRevisionAuthors, self).setUp()
135 launchpad_dbuser = config.launchpad.dbuser137 launchpad_dbuser = config.launchpad.dbuser
136 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)138 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
137 self.author = RevisionSet()._createRevisionAuthor(139 self.author = RevisionSet()._createRevisionAuthor(
@@ -171,6 +173,7 @@
171 layer = LaunchpadZopelessLayer173 layer = LaunchpadZopelessLayer
172174
173 def setUp(self):175 def setUp(self):
176 super(TestRevisionAuthor, self).setUp()
174 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)177 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
175178
176 def testGetNameWithoutEmailReturnsNamePart(self):179 def testGetNameWithoutEmailReturnsNamePart(self):
177180
=== modified file 'lib/lp/codehosting/puller/tests/test_worker.py'
--- lib/lp/codehosting/puller/tests/test_worker.py 2009-12-22 23:50:27 +0000
+++ lib/lp/codehosting/puller/tests/test_worker.py 2010-01-08 04:12:19 +0000
@@ -566,6 +566,7 @@
566 """Tests specific to `MirroredBranchPolicy`."""566 """Tests specific to `MirroredBranchPolicy`."""
567567
568 def setUp(self):568 def setUp(self):
569 super(TestMirroredBranchPolicy, self).setUp()
569 self.factory = LaunchpadObjectFactory()570 self.factory = LaunchpadObjectFactory()
570571
571 def testNoFileURL(self):572 def testNoFileURL(self):
572573
=== modified file 'lib/lp/codehosting/tests/test_rewrite.py'
--- lib/lp/codehosting/tests/test_rewrite.py 2009-11-05 19:06:56 +0000
+++ lib/lp/codehosting/tests/test_rewrite.py 2010-01-08 04:12:19 +0000
@@ -28,7 +28,7 @@
28 layer = DatabaseFunctionalLayer28 layer = DatabaseFunctionalLayer
2929
30 def setUp(self):30 def setUp(self):
31 TestCaseWithFactory.setUp(self)31 super(TestBranchRewriter, self).setUp()
32 self.fake_time = FakeTime(0)32 self.fake_time = FakeTime(0)
3333
34 def makeRewriter(self):34 def makeRewriter(self):
3535
=== modified file 'lib/lp/registry/tests/test_distroseries.py'
--- lib/lp/registry/tests/test_distroseries.py 2009-08-28 07:34:44 +0000
+++ lib/lp/registry/tests/test_distroseries.py 2010-01-08 04:12:19 +0000
@@ -34,6 +34,7 @@
3434
35 def setUp(self):35 def setUp(self):
36 # Log in as an admin, so that we can create distributions.36 # Log in as an admin, so that we can create distributions.
37 super(TestDistroSeriesCurrentSourceReleases, self).setUp()
37 login('foo.bar@canonical.com')38 login('foo.bar@canonical.com')
38 self.publisher = SoyuzTestPublisher()39 self.publisher = SoyuzTestPublisher()
39 self.factory = self.publisher.factory40 self.factory = self.publisher.factory
4041
=== modified file 'lib/lp/registry/tests/test_prf_walker.py'
--- lib/lp/registry/tests/test_prf_walker.py 2009-07-17 18:46:25 +0000
+++ lib/lp/registry/tests/test_prf_walker.py 2010-01-08 04:12:19 +0000
@@ -177,6 +177,7 @@
177177
178 def tearDown(self):178 def tearDown(self):
179 reset_logging()179 reset_logging()
180 super(WalkerBase_walk, self).tearDown()
180181
181 def test_walk_UnicodeEncodeError(self):182 def test_walk_UnicodeEncodeError(self):
182 """Verify that a UnicodeEncodeError is logged."""183 """Verify that a UnicodeEncodeError is logged."""
@@ -311,6 +312,7 @@
311312
312 def tearDown(self):313 def tearDown(self):
313 reset_logging()314 reset_logging()
315 super(HTTPWalker_ListDir, self).tearDown()
314316
315 def setUpWalker(self, listing_url, listing_content):317 def setUpWalker(self, listing_url, listing_content):
316 from lp.registry.scripts.productreleasefinder.walker import (318 from lp.registry.scripts.productreleasefinder.walker import (
@@ -487,6 +489,7 @@
487489
488 def tearDown(self):490 def tearDown(self):
489 reset_logging()491 reset_logging()
492 super(HTTPWalker_IsDirectory, self).tearDown()
490493
491 def testFtpIsDirectory(self):494 def testFtpIsDirectory(self):
492 # Test that no requests are made by isDirectory() when walking495 # Test that no requests are made by isDirectory() when walking
493496
=== modified file 'lib/lp/scripts/utilities/tests/test_sanitizedb.py'
--- lib/lp/scripts/utilities/tests/test_sanitizedb.py 2009-10-01 03:54:04 +0000
+++ lib/lp/scripts/utilities/tests/test_sanitizedb.py 2010-01-08 04:12:19 +0000
@@ -20,6 +20,7 @@
20 layer = DatabaseLayer20 layer = DatabaseLayer
2121
22 def setUp(self):22 def setUp(self):
23 super(SanitizeDbScriptTestCase, self).setUp()
23 self.script_path = os.path.join(24 self.script_path = os.path.join(
24 config.root, 'utilities', 'sanitize-db.py')25 config.root, 'utilities', 'sanitize-db.py')
25 DatabaseLayer.force_dirty_database()26 DatabaseLayer.force_dirty_database()
2627
=== modified file 'lib/lp/services/apachelogparser/tests/test_apachelogparser.py'
--- lib/lp/services/apachelogparser/tests/test_apachelogparser.py 2009-11-17 18:36:20 +0000
+++ lib/lp/services/apachelogparser/tests/test_apachelogparser.py 2010-01-08 04:12:19 +0000
@@ -230,6 +230,7 @@
230 root = os.path.join(here, 'apache-log-files')230 root = os.path.join(here, 'apache-log-files')
231231
232 def setUp(self):232 def setUp(self):
233 super(TestParsedFilesDetection, self).setUp()
233 self.layer.switchDbUser(DBUSER)234 self.layer.switchDbUser(DBUSER)
234235
235 def test_not_parsed_file(self):236 def test_not_parsed_file(self):
@@ -301,6 +302,7 @@
301 layer = LaunchpadZopelessLayer302 layer = LaunchpadZopelessLayer
302303
303 def setUp(self):304 def setUp(self):
305 super(Test_create_or_update_parsedlog_entry, self).setUp()
304 self.layer.switchDbUser(DBUSER)306 self.layer.switchDbUser(DBUSER)
305307
306 def test_creation_of_new_entries(self):308 def test_creation_of_new_entries(self):
307309
=== modified file 'lib/lp/services/database/tests/test_prejoin.py'
--- lib/lp/services/database/tests/test_prejoin.py 2009-10-28 12:38:31 +0000
+++ lib/lp/services/database/tests/test_prejoin.py 2010-01-08 04:12:19 +0000
@@ -20,6 +20,7 @@
20 layer = LaunchpadZopelessLayer20 layer = LaunchpadZopelessLayer
2121
22 def setUp(self):22 def setUp(self):
23 super(PrejoinTestCase, self).setUp()
23 self.store = IMasterStore(Product)24 self.store = IMasterStore(Product)
2425
25 # All products26 # All products
2627
=== modified file 'lib/lp/services/mail/tests/test_mailbox.py'
--- lib/lp/services/mail/tests/test_mailbox.py 2009-06-30 16:56:07 +0000
+++ lib/lp/services/mail/tests/test_mailbox.py 2010-01-08 04:12:19 +0000
@@ -19,12 +19,10 @@
19class TestDirectoryMailBox(TestCase):19class TestDirectoryMailBox(TestCase):
2020
21 def setUp(self):21 def setUp(self):
22 super(TestDirectoryMailBox, self).setUp()
22 # Create a temp directory.23 # Create a temp directory.
23 self.email_dir = tempfile.mkdtemp()24 self.email_dir = tempfile.mkdtemp()
2425 self.addCleanup(rmtree, self.email_dir)
25 def tearDown(self):
26 # Delete the directory.
27 rmtree(self.email_dir)
2826
29 def test_verify_interface(self):27 def test_verify_interface(self):
30 # Make sure that the object actually implements the interface.28 # Make sure that the object actually implements the interface.
3129
=== modified file 'lib/lp/services/memcache/tests/test_memcache_client.py'
--- lib/lp/services/memcache/tests/test_memcache_client.py 2009-10-15 13:04:44 +0000
+++ lib/lp/services/memcache/tests/test_memcache_client.py 2010-01-08 04:12:19 +0000
@@ -18,6 +18,7 @@
18 layer = LaunchpadZopelessLayer18 layer = LaunchpadZopelessLayer
1919
20 def setUp(self):20 def setUp(self):
21 super(MemcacheClientTestCase, self).setUp()
21 self.client = getUtility(IMemcacheClient)22 self.client = getUtility(IMemcacheClient)
2223
23 def test_basics(self):24 def test_basics(self):
2425
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2009-12-21 12:54:47 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2010-01-08 04:12:19 +0000
@@ -1236,6 +1236,7 @@
1236 The records annotated will be excluded during the operation checks,1236 The records annotated will be excluded during the operation checks,
1237 see checkCopies().1237 see checkCopies().
1238 """1238 """
1239 super(CopyPackageTestCase, self).setUp()
1239 pending_sources = SecureSourcePackagePublishingHistory.selectBy(1240 pending_sources = SecureSourcePackagePublishingHistory.selectBy(
1240 status=PackagePublishingStatus.PENDING)1241 status=PackagePublishingStatus.PENDING)
1241 self.sources_pending_ids = [pub.id for pub in pending_sources]1242 self.sources_pending_ids = [pub.id for pub in pending_sources]
12421243
=== modified file 'lib/lp/translations/scripts/tests/test_remove_translations.py'
--- lib/lp/translations/scripts/tests/test_remove_translations.py 2009-10-17 14:06:03 +0000
+++ lib/lp/translations/scripts/tests/test_remove_translations.py 2010-01-08 04:12:19 +0000
@@ -45,6 +45,7 @@
45 layer = LaunchpadZopelessLayer45 layer = LaunchpadZopelessLayer
4646
47 def setUp(self):47 def setUp(self):
48 super(TestRemoveTranslationsConstraints, self).setUp()
48 # Acquire privileges to delete TranslationMessages. We won't49 # Acquire privileges to delete TranslationMessages. We won't
49 # actually do that here, but we'll go through all the motions.50 # actually do that here, but we'll go through all the motions.
50 self.layer.switchDbUser('postgres')51 self.layer.switchDbUser('postgres')
@@ -155,6 +156,7 @@
155 layer = LaunchpadZopelessLayer156 layer = LaunchpadZopelessLayer
156157
157 def setUp(self):158 def setUp(self):
159 super(TestRemoveTranslationsOptionsHandling, self).setUp()
158 self.factory = LaunchpadObjectFactory()160 self.factory = LaunchpadObjectFactory()
159161
160 def test_WithNativeArgs(self):162 def test_WithNativeArgs(self):
@@ -222,6 +224,7 @@
222 layer = LaunchpadZopelessLayer224 layer = LaunchpadZopelessLayer
223225
224 def setUp(self):226 def setUp(self):
227 super(TestRemoveTranslations, self).setUp()
225 # Acquire privileges to delete TranslationMessages. That's not228 # Acquire privileges to delete TranslationMessages. That's not
226 # something we normally do. Actually we should test under229 # something we normally do. Actually we should test under
227 # rosettaadmin, but that user does not have all the privileges230 # rosettaadmin, but that user does not have all the privileges
@@ -553,6 +556,7 @@
553 layer = LaunchpadZopelessLayer556 layer = LaunchpadZopelessLayer
554557
555 def setUp(self):558 def setUp(self):
559 super(TestRemoveTranslationsUnmasking, self).setUp()
556 self.layer.switchDbUser('postgres')560 self.layer.switchDbUser('postgres')
557561
558 # Set up a template with a Laotian translation file. There's562 # Set up a template with a Laotian translation file. There's