~mandel/ubuntu-sso-client/ping_url_issues_windows

« back to all changes in this revision

Viewing changes to ubuntu_sso/tests/test_credentials.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2011-03-29 14:16:36 UTC
  • mfrom: (675.9.22 fix_732057)
  • Revision ID: tarmac-20110329141636-jvmiiniil946zi3n
Fixed bug by using the os module so that the correct null fd is used according to the platform.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
"""Tests for the Credentials module."""
20
20
 
21
21
import logging
 
22
import os
22
23
import urllib
23
24
 
24
25
from twisted.internet import defer
352
353
        def faked_urlopen(request):
353
354
            """Fake urlopener."""
354
355
            self._request = request
355
 
            response = urllib.addinfourl(fp=open('/dev/null'),
 
356
            response = urllib.addinfourl(fp=open(os.path.devnull),
356
357
                                         headers=request.headers,
357
358
                                         url=request.get_full_url(),
358
359
                                         code=200)