Merge lp:~mandel/ubuntuone-control-panel/fix-broken-tests into lp:ubuntuone-control-panel

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 315
Merged at revision: 314
Proposed branch: lp:~mandel/ubuntuone-control-panel/fix-broken-tests
Merge into: lp:ubuntuone-control-panel
Diff against target: 42 lines (+5/-5)
1 file modified
ubuntuone/controlpanel/tests/test_web_client.py (+5/-5)
To merge this branch: bzr merge lp:~mandel/ubuntuone-control-panel/fix-broken-tests
Reviewer Review Type Date Requested Status
Brian Curtin (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+101589@code.launchpad.net

Commit message

- Fixed all those broken tests on windows related to the dirty reactor left the mocked webserver by using the new implementation from ubuntuone-dev-tools (LP: #960436).

Description of the change

- Fixed all those broken tests on windows related to the dirty reactor left the mocked webserver by using the new implementation from ubuntuone-dev-tools (LP: #960436).

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Brian Curtin (brian.curtin) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

The attempt to merge lp:~mandel/ubuntuone-control-panel/fix-broken-tests into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running test suite for ubuntuone/controlpanel ***

Traceback (most recent call last):
  File "/usr/bin/u1trial", line 337, in <module>
    main()
  File "/usr/bin/u1trial", line 317, in main
    suite = trial_runner.get_suite(config)
  File "/usr/bin/u1trial", line 196, in get_suite
    config['ignore-paths']))
  File "/usr/bin/u1trial", line 180, in _collect_tests
    module_suite = self._load_unittest(filepath)
  File "/usr/bin/u1trial", line 120, in _load_unittest
    module = __import__(modpath, None, None, [""])
  File "/mnt/tarmac/cache/ubuntuone-control-panel/trunk/ubuntuone/controlpanel/tests/test_web_client.py", line 24, in <module>
    from ubuntuone.devtools.testcases.txwebserver import WebServer
ImportError: No module named txwebserver

315. By Manuel de la Peña

Use the new api.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/tests/test_web_client.py'
2--- ubuntuone/controlpanel/tests/test_web_client.py 2012-03-13 11:26:12 +0000
3+++ ubuntuone/controlpanel/tests/test_web_client.py 2012-04-18 16:12:51 +0000
4@@ -21,7 +21,7 @@
5 from twisted.internet import defer
6 from twisted.web import resource
7
8-from ubuntu_sso.utils.webclient.tests import BaseMockWebServer
9+from ubuntuone.devtools.testing.txwebserver import HTTPWebServer
10
11 from ubuntuone.controlpanel.tests import TestCase
12 from ubuntuone.controlpanel.web_client import (
13@@ -73,10 +73,10 @@
14 return self.contents
15
16
17-class MockWebServer(BaseMockWebServer):
18+class MockWebServer(HTTPWebServer):
19 """A mock webserver for the webclient tests."""
20
21- def get_root_resource(self):
22+ def __init__(self):
23 """Get the root resource with all the children."""
24 root = resource.Resource()
25 devices_resource = MockResource()
26@@ -86,8 +86,7 @@
27 unauthorized = resource.ErrorPage(resource.http.UNAUTHORIZED,
28 "Unauthrorized", "Unauthrorized")
29 root.putChild("unauthorized", unauthorized)
30-
31- return root
32+ super(MockWebServer, self).__init__(root)
33
34
35 class WebClientTestCase(TestCase):
36@@ -99,6 +98,7 @@
37 def setUp(self):
38 yield super(WebClientTestCase, self).setUp()
39 self.ws = MockWebServer()
40+ self.ws.start()
41 self.addCleanup(self.ws.stop)
42 self.base_iri = self.ws.get_iri()
43

Subscribers

People subscribed via source and target branches

to all changes: