Added FMS and GW Test cases as a part of sanity

Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
shivamcandela
2021-09-19 15:15:31 +05:30
parent 4b1653c89f
commit c807e32a96
8 changed files with 256 additions and 208 deletions

View File

@@ -7,11 +7,12 @@ import pytest
import json
import allure
@pytest.mark.uc_sanityw
@allure.feature("SDK REST API")
class TestUcentralGatewayService(object):
"""
"""
@pytest.mark.sdk_restapi
def test_gwservice_listdevices(self, setup_controller):
"""
@@ -24,7 +25,7 @@ class TestUcentralGatewayService(object):
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
print (devices)
print(devices)
@pytest.mark.sdk_restapi
def test_gwservice_createdevice(self, setup_controller):
@@ -48,7 +49,7 @@ class TestUcentralGatewayService(object):
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
print (devices)
print(devices)
resp = setup_controller.request("gw", "device/DEADBEEF0011", "GET", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -83,7 +84,7 @@ class TestUcentralGatewayService(object):
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
print (devices)
print(devices)
payload = {'serialNumber': 'DEADBEEF0011',
'owner': 'pytest'}
@@ -100,8 +101,7 @@ class TestUcentralGatewayService(object):
assert False
device = json.loads(resp.text)
print (device)
print(device)
resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -130,12 +130,10 @@ class TestUcentralGatewayService(object):
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
print (devices)
print(devices)
resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
allure.attach(name="gw get device", body=body)
if resp.status_code != 200:
assert False