-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enable missed return types for generic (#1485)
* tests, support for dict & httpresp * support for returning list * added support for int, double * bool support, unit tests --------- Co-authored-by: Victoria Hall <[email protected]>
- Loading branch information
1 parent
b0bacf0
commit 8214d0c
Showing
31 changed files
with
624 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_bool/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return bool") | ||
return True |
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_bytes/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return bytes") | ||
return "test-dată" |
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_dict/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return dict") | ||
return {"hello": "world"} |
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_double/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return double") | ||
return 12.34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return int") | ||
return 12 |
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_list/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return list") | ||
return [1, 2, 3] |
21 changes: 21 additions & 0 deletions
21
tests/endtoend/generic_functions/return_string/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scriptFile": "main.py", | ||
"bindings": [ | ||
{ | ||
"name": "mytimer", | ||
"type": "timerTrigger", | ||
"direction": "in", | ||
"schedule": "*/1 * * * * *", | ||
"runOnStartup": false | ||
}, | ||
{ | ||
"direction": "in", | ||
"type": "table", | ||
"name": "testEntity", | ||
"partitionKey": "test", | ||
"rowKey": "WillBePopulatedWithGuid", | ||
"tableName": "BindingTestTable", | ||
"connection": "AzureWebJobsStorage" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import logging | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(mytimer: func.TimerRequest, testEntity): | ||
logging.info("Return string") | ||
return "hi!" |
Oops, something went wrong.