mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 20:07:57 +00:00
cloudsdk unit tests working
Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -1,26 +1,29 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if 'cloudsdk' not in sys.path:
|
if 'cloudsdk' not in sys.path:
|
||||||
sys.path.append(f'../../libs/cloudsdk')
|
sys.path.append(f'../../libs/cloudsdk')
|
||||||
from cloudsdk import CloudSDK
|
from cloudsdk import CloudSDK
|
||||||
|
|
||||||
@pytest.mark.login
|
|
||||||
class TestLogin:
|
|
||||||
|
|
||||||
def test_token_login(self):
|
@pytest.mark.userfixtures('get_customer_id')
|
||||||
|
@pytest.mark.userfixtures('get_testbed_name')
|
||||||
|
@pytest.mark.login
|
||||||
|
class TestLogin(object):
|
||||||
|
|
||||||
|
def test_token_login(self, get_customer_id, get_testbed_name):
|
||||||
try:
|
try:
|
||||||
obj = CloudSDK(testbed="nola-ext-04", customer_id=2)
|
obj = CloudSDK(testbed=get_testbed_name, customer_id=get_customer_id)
|
||||||
bearer = obj.get_bearer_token()
|
bearer = obj.get_bearer_token()
|
||||||
value = bearer._access_token is None
|
value = bearer._access_token is None
|
||||||
except:
|
except:
|
||||||
value = True
|
value = True
|
||||||
assert value == False
|
assert value == False
|
||||||
|
|
||||||
def test_ping(self):
|
def test_ping(self, get_customer_id, get_testbed_name):
|
||||||
try:
|
try:
|
||||||
obj = CloudSDK(testbed="nola-ext-04", customer_id=2)
|
obj = CloudSDK(testbed=get_testbed_name, customer_id=get_customer_id)
|
||||||
value = obj.portal_ping() is None
|
value = obj.portal_ping() is None
|
||||||
except:
|
except:
|
||||||
value = True
|
value = True
|
||||||
assert value == False
|
assert value == False
|
||||||
|
|
||||||
|
|||||||
@@ -76,4 +76,12 @@ def instantiate_cloudsdk(request):
|
|||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def instantiate_jFrog(request):
|
def instantiate_jFrog(request):
|
||||||
yield "instantiate_jFrog"
|
yield "instantiate_jFrog"
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def get_customer_id(request):
|
||||||
|
yield request.config.getini("sdk-customer-id")
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def get_testbed_name(request):
|
||||||
|
yield request.config.getini("testbed-name")
|
||||||
|
|||||||
Reference in New Issue
Block a user