Revision 21190887 astakosclient/astakosclient/tests.py

b/astakosclient/astakosclient/tests.py
71 71

  
72 72
def _request_status_302(conn, method, url, **kwargs):
73 73
    """This request returns 302"""
74
    message = "FOUND"
74 75
    status = 302
75 76
    data = '<html>\r\n<head><title>302 Found</title></head>\r\n' \
76 77
        '<body bgcolor="white">\r\n<center><h1>302 Found</h1></center>\r\n' \
77 78
        '<hr><center>nginx/0.7.67</center>\r\n</body>\r\n</html>\r\n'
78
    return (data, status)
79
    return (message, data, status)
79 80

  
80 81

  
81 82
def _request_status_404(conn, method, url, **kwargs):
82 83
    """This request returns 404"""
84
    message = "Not Found"
83 85
    status = 404
84 86
    data = '<html><head><title>404 Not Found</title></head>' \
85 87
        '<body><h1>Not Found</h1><p>The requested URL /foo was ' \
86 88
        'not found on this server.</p><hr><address>Apache Server ' \
87 89
        'at example.com Port 80</address></body></html>'
88
    return (data, status)
90
    return (message, data, status)
89 91

  
90 92

  
91 93
def _request_status_401(conn, method, url, **kwargs):
92 94
    """This request returns 401"""
95
    message = "UNAUTHORIZED"
93 96
    status = 401
94 97
    data = "Invalid X-Auth-Token\n"
95
    return (data, status)
98
    return (message, data, status)
96 99

  
97 100

  
98 101
def _request_status_400(conn, method, url, **kwargs):
99 102
    """This request returns 400"""
103
    message = "BAD REQUEST"
100 104
    status = 400
101 105
    data = "Method not allowed.\n"
102
    return (data, status)
106
    return (message, data, status)
103 107

  
104 108

  
105 109
def _request_ok(conn, method, url, **kwargs):
......
136 140
    if "usage=1" not in url:
137 141
        # Strip `usage' key from `user'
138 142
        del user['usage']
139
    return (simplejson.dumps(user), 200)
143
    return ("", simplejson.dumps(user), 200)
140 144

  
141 145

  
142 146
def _req_catalogs(conn, method, url, **kwargs):
......
176 180
        return_catalog = {"displayname_catalog": catalogs, "uuid_catalog": {}}
177 181
    else:
178 182
        return_catalog = {"displayname_catalog": {}, "uuid_catalog": {}}
179
    return (simplejson.dumps(return_catalog), 200)
183
    return ("", simplejson.dumps(return_catalog), 200)
180 184

  
181 185

  
182 186
# ----------------------------

Also available in: Unified diff