def test_create_method(): name = "testmethod" desc = "this is a test method" scope = "public" ret = "void" m = models.new_method(name, scope, ret, desc, c.id) assert m["id"] is not None and m["name"] == name
def new_method(json_obj): if "id" not in json_obj: mid = None args = None else: mid = json_obj["id"] args = json_obj["arguments"] return models.new_method(json_obj["name"], json_obj["scope"], json_obj["ret"], json_obj["description"], json_obj["class_id"], args, mid)