~ubuntu-branches/ubuntu/quantal/ubuntu-sso-client/quantal-proposed

« back to all changes in this revision

Viewing changes to ubuntu_sso/utils/webclient/tests/test_timestamp.py

  • Committer: Package Import Robot
  • Author(s): Rodney Dawes
  • Date: 2012-06-15 16:52:27 UTC
  • mfrom: (1.1.37)
  • Revision ID: package-import@ubuntu.com-20120615165227-lpe6wcbwwsk48olx
Tags: 3.99.0-0ubuntu1
* New upstream release.
  - Remove some code duplication in web client. (LP: #904842)
  - Handle starting with the -testsability argument. (LP: #984964)
  - Log more details for SSL validation failure. (LP: #987405)
  - Use the new dev-tools API in tests. (LP: #988809)
  - Use the network detection page before signup/login. (LP: #996025)
  - Fix size of password assistance label in reset dialog. (LP: #999885)
  - ubuntu-sso-login-qt crashed with TypeError in got_state. (LP: #1003692)
* debian/control:
  - Update dependencies to allow running unit tests during build.
* debian/patches:
  - Remove upstreamed patches.
* debian/patches/00_bug711413.patch:
  - Trap DBusException when connecting to session bus. (LP: #711413)
* debian/patches/01_bug882055.patch:
  - Tell libsoup to use strict ssl with system ca certs. (LP: #882055)
* debian/rules:
  - Enable unit tests during build.
* debian/watch:
  - Update to use stable-4-0 series for Quantal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from twisted.trial.unittest import TestCase
33
33
from twisted.web import resource
34
34
 
 
35
from ubuntuone.devtools.testing.txwebserver import HTTPWebServer
 
36
 
35
37
from ubuntu_sso.utils.webclient import timestamp, webclient_module
36
 
from ubuntu_sso.utils.webclient.tests import BaseMockWebServer
37
38
 
38
39
 
39
40
class FakedError(Exception):
59
60
        return ""
60
61
 
61
62
 
62
 
class MockWebServer(BaseMockWebServer):
 
63
class MockWebServer(HTTPWebServer):
63
64
    """A mock webserver for testing."""
64
65
 
65
 
    def get_root_resource(self):
66
 
        """Get the root resource with all the children."""
67
 
        return RootResource()
 
66
    def __init__(self):
 
67
        """Create a new server."""
 
68
        super(MockWebServer, self).__init__(RootResource())
68
69
 
69
70
 
70
71
class TimestampCheckerTestCase(TestCase):
71
72
    """Tests for the timestamp checker."""
72
73
 
73
 
    timeout = 1
 
74
    timeout = 5
74
75
 
75
76
    @defer.inlineCallbacks
76
77
    def setUp(self):
77
78
        yield super(TimestampCheckerTestCase, self).setUp()
78
79
        self.ws = MockWebServer()
 
80
        self.ws.start()
79
81
        self.addCleanup(self.ws.stop)
80
82
        self.webclient_class = webclient_module().WebClient
81
83
        self.patch(timestamp.TimestampChecker, "SERVER_IRI", self.ws.get_iri())