Added comments

This commit is contained in:
Jaspreet Sachdev
2021-08-12 12:03:00 -04:00
parent 003cc25a71
commit d529676c6c
2 changed files with 47 additions and 7 deletions

View File

@@ -15,6 +15,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi
def test_gwservice_listdevices(self, setup_controller):
"""
Test the list devices endpoint
WIFI-3452
"""
resp = setup_controller.request("gw", "devices", "GET", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -27,6 +29,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi
def test_gwservice_createdevice(self, setup_controller):
"""
Test the create device endpoint
WIFI-3453
"""
configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011',
@@ -61,6 +65,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi
def test_gwservice_updatedevice(self, setup_controller):
"""
Test the update device endpoint
WIFI-3454
"""
configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011',
@@ -102,3 +108,34 @@ class TestUcentralGatewayService(object):
allure.attach(name="gw get device", body=body)
if resp.status_code != 200:
assert False
@pytest.mark.sdk_restapi
def test_gwservice_deletedevice(self, setup_controller):
"""
Test the delete device endpoint
WIFI-3455
"""
configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011',
'UUID': '123456',
'configuration': configuration,
'deviceType': 'AP',
'location': '',
'macAddress': 'DE:AD:BE:EF:00:11',
'manufacturer': 'Testing',
'owner': ''}
resp = setup_controller.request("gw", "device/DEADBEEF0011", "POST", None, json.dumps(payload))
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
allure.attach(name="gw create devices", body=body)
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
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