def test_extract_parameters_names_multiple(): class HandlerWithMultipleParameter(tornado.web.RequestHandler): def get(self, posts_id, post_id2, post_id3): pass parameters = _extract_parameters_names(HandlerWithMultipleParameter, 3) assert parameters == ['posts_id', 'post_id2', 'post_id3']
def test_extract_parameters_names_empty_parameter(): class HandlerWithEmptyParameter(tornado.web.RequestHandler): def get(self): pass parameters = _extract_parameters_names(HandlerWithEmptyParameter, 0) assert parameters == []
def test_extract_parameters_names_signle_parameter(): class HandlerWithSingleParameter(tornado.web.RequestHandler): def get(self, posts_id): pass parameters = _extract_parameters_names(HandlerWithSingleParameter, 1) assert parameters == ['posts_id']
def test_extract_parameters_names_multiple(): class HandlerWithMultipleParameter(tornado.web.RequestHandler): def get(self, posts_id, post_id2, post_id3): pass parameters = _extract_parameters_names(HandlerWithMultipleParameter, 3, method="get") assert parameters == ["posts_id", "post_id2", "post_id3"]