Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@autorest/autorest": "^3.0.0",
"@microsoft.azure/autorest.testserver": "^2.10.61"
"@microsoft.azure/autorest.testserver": "^2.10.62"
},
"files": [
"autorest/**/*.py",
Expand Down
3 changes: 2 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
'AcceptanceTests/MediaTypes': 'media_types.json',
'AcceptanceTests/ObjectType': 'object-type.json',
'AcceptanceTests/NonStringEnums': 'non-string-enum.json',
'AcceptanceTests/MultipleInheritance': 'multiple-inheritance.json'
'AcceptanceTests/MultipleInheritance': 'multiple-inheritance.json',
'AcceptanceTests/NoOperations': 'no-operations.json',
}

default_azure_mappings = {
Expand Down
39 changes: 39 additions & 0 deletions test/vanilla/AcceptanceTests/test_no_operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
import sys

class TestNoOperations:
def test_models(self):
from nooperations.models import Error

if sys.version_info >= (3,5):
from nooperations.models._models_py3 import Error as ErrorPy3
assert Error == ErrorPy3
else:
from nooperations.models._models import Error as ErrorPy2
assert Error == ErrorPy2

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "0.1.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

try:
from ._models_py3 import Error
except (SyntaxError, ImportError):
from ._models import Error # type: ignore

__all__ = [
'Error',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import msrest.serialization


class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
"""

_attribute_map = {
'status': {'key': 'status', 'type': 'int'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(
self,
**kwargs
):
super(Error, self).__init__(**kwargs)
self.status = kwargs.get('status', None)
self.message = kwargs.get('message', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Optional

import msrest.serialization


class Error(msrest.serialization.Model):
"""Error.

:param status:
:type status: int
:param message:
:type message: str
"""

_attribute_map = {
'status': {'key': 'status', 'type': 'int'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(
self,
*,
status: Optional[int] = None,
message: Optional[str] = None,
**kwargs
):
super(Error, self).__init__(**kwargs)
self.status = status
self.message = message
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Marker file for PEP 561.
37 changes: 37 additions & 0 deletions test/vanilla/Expected/AcceptanceTests/NoOperations/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# coding: utf-8

from setuptools import setup, find_packages

NAME = "nooperationsserviceclient"
VERSION = "0.1.0"

# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

REQUIRES = ["msrest>=0.6.18", "azure-core<2.0.0,>=1.8.2"]

setup(
name=NAME,
version=VERSION,
description="NoOperationsServiceClient",
author_email="",
url="",
keywords=["Swagger", "NoOperationsServiceClient"],
install_requires=REQUIRES,
packages=find_packages(),
include_package_data=True,
long_description="""\
Service client with no operations.
"""
)
1 change: 1 addition & 0 deletions test/vanilla/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ aiohttp;python_full_version>="3.5.2"
-e ./Expected/AcceptanceTests/MediaTypes
-e ./Expected/AcceptanceTests/ModelFlattening
-e ./Expected/AcceptanceTests/MultipleInheritance
-e ./Expected/AcceptanceTests/NoOperations
-e ./Expected/AcceptanceTests/NonStringEnums
-e ./Expected/AcceptanceTests/ObjectType
-e ./Expected/AcceptanceTests/ParameterFlattening
Expand Down