-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding User-Agent and updating model definitions
Updated ask-sdk-model-runtime test cases to use UnitTest framework
- Loading branch information
Govinda Raju
committed
Dec 19, 2019
1 parent
eb55886
commit 74ea73b
Showing
20 changed files
with
563 additions
and
252 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
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,39 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights | ||
# Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | ||
# OF ANY KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations under the | ||
# License. | ||
# | ||
import sys | ||
|
||
def user_agent_info(sdk_version, custom_user_agent): | ||
# type: (str, str) -> str | ||
"""Return the user agent info along with the SDK and Python | ||
Version information. | ||
:param sdk_version: Version of the SDK being used. | ||
:type sdk_version: str | ||
:param custom_user_agent: Custom User Agent string provided by | ||
the developer. | ||
:type custom_user_agent: str | ||
:return: User Agent Info string | ||
:rtype: str | ||
""" | ||
python_version = ".".join(str(x) for x in sys.version_info[0:3]) | ||
user_agent = "ask-python-model/{} Python/{}".format( | ||
sdk_version, python_version) | ||
if custom_user_agent is None: | ||
return user_agent | ||
else: | ||
return user_agent + " " + custom_user_agent |
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
Oops, something went wrong.