~ubuntuone-control-tower/ubuntu-sso-client/trunk

« back to all changes in this revision

Viewing changes to ubuntu_sso/tests/test_account.py

Try Python 3 urllib names and fall back to Python 2 as needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
"""Tests for the SSO account code."""
33
33
 
34
34
import os
35
 
import urllib2
36
35
 
37
36
from twisted.trial.unittest import TestCase
38
37
from twisted.internet import defer
39
38
 
40
39
from ubuntu_sso import account
 
40
from ubuntu_sso import utils
41
41
from ubuntu_sso.account import (
42
42
    Account,
43
43
    AuthenticationError,
215
215
            self.addCleanup(f.close)
216
216
            return f
217
217
 
218
 
        self.patch(urllib2, 'urlopen', fake_urlopen)  # fd to the path
 
218
        self.patch(utils, 'urlopen', fake_urlopen)  # fd to the path
219
219
        self.processor = Account()
220
220
        self.register_kwargs = dict(email=EMAIL, password=PASSWORD,
221
221
                                    displayname=NAME,