예제 #1
0
파일: error.py 프로젝트: taftsanders/pulp
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
예제 #2
0
 def test_current_link_obj(self, mock_path):
     ret = link.current_link_obj()
     self.assertEqual(ret, {'_href': '/base/uri/repo1/'})
예제 #3
0
 def test_current_link_obj(self, mock_path):
     ret = link.current_link_obj()
     self.assertEqual(ret, {'_href': '/base/uri/repo1/'})