-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6.0 API
- Loading branch information
Showing
189 changed files
with
26,164 additions
and
12,040 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Python package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
python-version: [2.7, 3.5, 3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install msrest | ||
- name: Python compile | ||
run: | | ||
python -m compileall . | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pytest |
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
File renamed without changes.
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,47 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
import pprint | ||
import unittest | ||
|
||
from msrest import Deserializer | ||
from msrest.universal_http import HTTPClientResponse | ||
|
||
|
||
class _TestResponse(HTTPClientResponse): | ||
def __init__(self, text): | ||
super(_TestResponse, self).__init__(request=None, internal_response=None) | ||
self._text = text | ||
|
||
def text(self, encoding=None): | ||
return self._text | ||
|
||
|
||
class TestDeserialization(unittest.TestCase): | ||
|
||
# https://github.com/microsoft/azure-devops-python-api/issues/268 | ||
def test_deserialization_issue_268_51(self): | ||
from azure.devops.v5_1.task_agent import models | ||
self._test_deserialization(models.__dict__.items(), _268_type, _268_json) | ||
|
||
# https://github.com/microsoft/azure-devops-python-api/issues/268 | ||
def test_deserialization_issue_268_60(self): | ||
from azure.devops.v6_0.task_agent import models | ||
self._test_deserialization(models.__dict__.items(), _268_type, _268_json) | ||
|
||
@staticmethod | ||
def _test_deserialization(models, data_type, json): | ||
client_models = {k: v for k, v in models if isinstance(v, type)} | ||
deserializer = Deserializer(client_models) | ||
response = _TestResponse(json) | ||
task_agent_response = deserializer(data_type, response) | ||
pprint.pprint(task_agent_response.__dict__) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
||
_268_type = 'TaskAgentReference' | ||
_268_json = '{"id":0,"name":null,"version":null,"osDescription":"Foo","provisioningState":null}' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.