~ubuntu-branches/ubuntu/saucy/python-glanceclient/saucy

« back to all changes in this revision

Viewing changes to tests/utils.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 10:22:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20121123102206-0dlq52aydhudnrrc
Tags: 1:0.6.0-0ubuntu1
[ Adam Gandelman ]
* Ensure python-prettytable >= 0.6. (LP: #1073275)
* debian/control, pydist-overrides: Add python-openssl override.

[ Chuck Short ]
* New usptream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
 
42
42
class FakeResponse(object):
43
 
    def __init__(self, headers):
 
43
    def __init__(self, headers, body=None):
 
44
        """
 
45
        :param headers: dict representing HTTP response headers
 
46
        :param body: file-like object
 
47
        """
44
48
        self.headers = headers
 
49
        self.body = body
45
50
 
46
51
    def getheaders(self):
47
52
        return copy.deepcopy(self.headers).items()
48
53
 
49
54
    def getheader(self, key, default):
50
55
        return self.headers.get(key, default)
 
56
 
 
57
    def read(self, amt):
 
58
        return self.body.read(amt)