Ejemplo n.º 1
0
def http_error_obj(http_status, msg=None):
    """
    Serialize an http error.
    @param http_status: valid http status number
    @type http_status: int
    @param msg: error message
    @type: str
    @return: serialized error
    @rtype: dict
    """
    error_obj = copy.copy(_ERROR_OBJ_SKEL)
    error_obj['http_request_method'] = request_method()
    error_obj['http_status'] = http_status
    error_obj['error_message'] = msg
    error_obj.update(link.current_link_obj())
    return error_obj
Ejemplo n.º 2
0
 def test_current_link_obj(self, mock_path):
     ret = link.current_link_obj()
     self.assertEqual(ret, {'_href': '/base/uri/repo1/'})
Ejemplo n.º 3
0
 def test_current_link_obj(self, mock_path):
     ret = link.current_link_obj()
     self.assertEqual(ret, {'_href': '/base/uri/repo1/'})