Skip to content

Commit

Permalink
fix: remove warnings in test model
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Mar 25, 2024
1 parent 6b7874a commit b101b68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
43 changes: 28 additions & 15 deletions deepaas/model/v2/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,40 +111,53 @@ def train(self, *args, **kwargs):
def get_predict_args(self):
return {
"data": fields.Field(
description="Data file to perform inference.",
metadata={
"description": "Data file to perform inference.",
"location": "form",
"type": "file",
},
required=True,
location="form",
type="file",
),
"parameter": fields.Int(
description="This is a parameter for prediction", required=True
metadata={"description": "This is a parameter for prediction"},
required=True,
),
"parameter_three": fields.Str(
description=(
"This is a parameter that forces its value to "
"be one of the choices declared in 'enum'"
),
enum=["foo", "bar"],
metadata={
"description": (
"This is a parameter that forces its value to "
"be one of the choices declared in 'enum'"
),
"enum": ["foo", "bar"],
},
validate=validate.OneOf(["foo", "bar"]),
),
"accept": fields.Str(
description=(
"Media type(s) that is/are acceptable for the " "response."
),
metadata={
"description": (
"Media type(s) that is/are acceptable for the " "response."
),
"location": "headers",
},
validate=validate.OneOf(
["application/json", "text/plain", "image/png"]
),
location="headers",
),
}

def get_train_args(self):
return {
"sleep": fields.Int(
required=True,
descripton="This is a integer parameter, and it is " "a required one.",
metadata={
"descripton": (
"This is a integer parameter, and it is " "a required one."
),
},
),
"parameter_two": fields.Str(
metadata={"description": "This is a string parameter."}
),
"parameter_two": fields.Str(description="This is a string parameter."),
}

def get_metadata(self):
Expand Down
1 change: 0 additions & 1 deletion deepaas/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class TestCase(testtools.TestCase, aiohttp.test_utils.AioHTTPTestCase):

"""Base unit test class."""

async def get_application(self):
Expand Down

0 comments on commit b101b68

Please sign in to comment.