Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
add one test for ci
  • Loading branch information
iscai-msft committed May 13, 2021
commit c4bba6499b848a7ed7b66e735b2bd78493593367
15 changes: 15 additions & 0 deletions sdk/agrifood/azure-agrifood-farming/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
# --------------------------------------------------------------------------

import sys

# fixture needs to be visible from conftest

# Ignore async tests for Python < 3.5
collect_ignore_glob = []
if sys.version_info < (3, 5):
collect_ignore_glob.append("*_async.py")
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: GET
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer/boundaries/fake-boundaryboundary?api-version=2021-03-31-preview
response:
body:
string: '{"error":{"code":"ResourceNotFound","message":"Resource with id ''fake-boundaryboundary''
does not exist for provided farmerId.","target":null,"details":null,"innererror":null},"traceId":"0HM8KA76V1Q64:00000001"}'
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '211'
content-type:
- application/json
date:
- Thu, 13 May 2021 15:49:51 GMT
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
status:
code: 404
message: Not Found
- request:
body: '{"geometry": {"coordinates": [[[73.70457172393799, 20.545385304358106],
[73.70457172393799, 20.545385304358106], [73.70448589324951, 20.542411534243367],
[73.70877742767334, 20.541688176010233], [73.71023654937744, 20.545083911372505],
[73.70663166046143, 20.546992723579137], [73.70457172393799, 20.545385304358106]]],
"type": "Polygon"}, "description": "Created by SDK"}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '372'
Content-Type:
- application/merge-patch+json
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: PATCH
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer/boundaries/fake-boundaryboundary?api-version=2021-03-31-preview
response:
body:
string: '{"farmerId":"fake-farmer","geometry":{"type":"Polygon","coordinates":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},"isPrimary":false,"acreage":60.40491151079627,"id":"fake-boundaryboundary","eTag":"00008362-0000-0600-0000-609d4aa00000","createdDateTime":"2021-05-13T15:49:52Z","modifiedDateTime":"2021-05-13T15:49:52Z","description":"Created
by SDK"}'
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '584'
content-type:
- application/json; charset=utf-8
date:
- Thu, 13 May 2021 15:49:52 GMT
etag:
- 00008362-0000-0600-0000-609d4aa00000
location:
- http://sdk-testing-wcus-1.farmbeats.azure.net/farmers/fake-farmer/boundaries/fake-boundaryboundary
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
status:
code: 201
message: Created
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: GET
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer/boundaries/fake-boundaryboundary?api-version=2021-03-31-preview
response:
body:
string: '{"farmerId":"fake-farmer","geometry":{"type":"Polygon","coordinates":[[[73.70457172393799,20.545385304358106],[73.70457172393799,20.545385304358106],[73.70448589324951,20.542411534243367],[73.70877742767334,20.541688176010233],[73.71023654937744,20.545083911372505],[73.70663166046143,20.546992723579137],[73.70457172393799,20.545385304358106]]]},"isPrimary":false,"acreage":60.40491151079627,"id":"fake-boundaryboundary","eTag":"00008362-0000-0600-0000-609d4aa00000","createdDateTime":"2021-05-13T15:49:52Z","modifiedDateTime":"2021-05-13T15:49:52Z","description":"Created
by SDK"}'
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '584'
content-type:
- application/json; charset=utf-8
date:
- Thu, 13 May 2021 15:49:52 GMT
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '0'
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: DELETE
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer/boundaries/fake-boundaryboundary?api-version=2021-03-31-preview
response:
body:
string: ''
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '0'
date:
- Thu, 13 May 2021 15:49:53 GMT
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
status:
code: 204
message: No Content
version: 1

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
interactions:
- request:
body: '{}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '2'
Content-Type:
- application/merge-patch+json
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: PATCH
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer?api-version=2021-03-31-preview
response:
body:
string: '{"id":"fake-farmer","eTag":"00001161-0000-0600-0000-609d47740000","createdDateTime":"2021-05-13T15:36:20Z","modifiedDateTime":"2021-05-13T15:36:20Z"}'
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '150'
content-type:
- application/json; charset=utf-8
date:
- Thu, 13 May 2021 15:36:20 GMT
etag:
- 00001161-0000-0600-0000-609d47740000
location:
- http://sdk-testing-wcus-1.farmbeats.azure.net/farmers/fake-farmer
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
status:
code: 201
message: Created
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- azsdk-python-agrifood-farming/1.0.0b1 Python/3.9.1 (macOS-10.16-x86_64-i386-64bit)
method: GET
uri: https://fakeAccount.farmbeats.azure.net/farmers/fake-farmer?api-version=2021-03-31-preview
response:
body:
string: '{"id":"fake-farmer","eTag":"00001161-0000-0600-0000-609d47740000","createdDateTime":"2021-05-13T15:36:20Z","modifiedDateTime":"2021-05-13T15:36:20Z"}'
headers:
api-deprecated-versions:
- 2020-12-31-preview
api-supported-versions:
- 2021-03-31-preview
connection:
- keep-alive
content-length:
- '150'
content-type:
- application/json; charset=utf-8
date:
- Thu, 13 May 2021 15:36:21 GMT
etag:
- 00001161-0000-0600-0000-609d47740000
server:
- nginx/1.19.1
strict-transport-security:
- max-age=15724800; includeSubDomains
status:
code: 200
message: OK
version: 1
Loading