def test_users(self, vpp: VPP): cursor = vpp.users() while cursor.next(): users = cursor.users print(users) print('cursor exhausted')
def get_vpp() -> VPP: vpp = getattr(g, '_vpp', None) if vpp is None: g._vpp = VPP(current_app.config['VPP_STOKEN']) return vpp
def get_vpp() -> VPP: vpp = getattr(g, '_vpp', None) if vpp is None: if 'VPP_STOKEN' not in current_app.config: raise VPPError('VPP stoken not configured') g._vpp = VPP(current_app.config['VPP_STOKEN']) return vpp
def test_licenses(self, vpp: VPP): cursor = vpp.licenses(VPP_BATCH_LICENSE_ADAMID) licenses = [] total = cursor.total assert len(cursor.licenses) == 600 licenses = licenses + cursor.licenses while cursor.next(): licenses = licenses + cursor.licenses assert len(licenses) == total
def test_manage_one_license(self, vpp: VPP): op = vpp.manage(VPP_BATCH_LICENSE_ADAMID) op.add(LicenseAssociationType.ClientUserID, VPP_MOCK_USER_CID) vpp.save(op)
def test_get_assets(self, vpp: VPP): reply = vpp.assets() assert 'assets' in reply
def test_edit_user_by_client_id(self, vpp: VPP): reply = vpp.edit_user(client_user_id=VPP_MOCK_USER_CID, email=VPP_MOCK_USER_EMAIL_2) assert reply['status'] == 0 assert reply['user']['email'] == VPP_MOCK_USER_EMAIL_2
def test_retireuser_by_client_id(self, vpp: VPP): reply = vpp.retire_user(client_user_id=VPP_MOCK_USER_CID) assert reply['status'] == 0
def test_getuser_by_user_id(self, vpp: VPP): reply = vpp.get_user(user_id=VPP_MOCK_USER_ID) assert reply['status'] == 0 assert 'user' in reply
def test_vpp_register_user(self, vpp: VPP): reply = vpp.register_user(VPP_MOCK_USER_CID, VPP_MOCK_USER_EMAIL) assert reply['status'] == 0 assert 'user' in reply
def vpp(simulator_token: str) -> VPP: return VPP( stoken=simulator_token, vpp_service_config_url='http://localhost:8080/VPPServiceConfigSrv', service_config=SERVICE_CONFIG)