How to use unexpectedError method in prospector

Best Python code snippet using prospector_python

store-indexeddb-tests.js

Source:store-indexeddb-tests.js Github

copy

Full Screen

1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19 20// store-indexeddb-tests.js21(function (window, undefined) {22 // DATAJS INTERNAL START23 var unexpectedSuccess = function (key, value) {24 djstest.fail("Unexpected call to success handler: key = " + key + ", value = " + value);25 djstest.done();26 };27 var unexpectedError = function (e) {28 djstest.fail("Unexpected call to error handler: " + djstest.toString(e));29 djstest.done();30 };31 var storeCounter = 0;32 var storeName = "test";33 var getNextStoreName = function () {34 storeCounter++;35 return getCurrentStoreName();36 };37 var getCurrentStoreName = function(){38 return storeName + storeCounter;39 };40 var oldWindowOnError;41 if (djstest.indexedDB) {42 module("Unit", {43 setup: function () {44 djstest.wait(function (done) {45 djstest.cleanStoreOnIndexedDb([{ name: getNextStoreName() }], done);46 });47 // FireFox 7.0.1 bubbles an error event when there is an IndexedDB error, even when the error has been handled graciously.48 // This is a work around to keep QUnit from reporting false failures in IndexedDB negative tests.49 oldWindowOnError = window.onerror;50 window.onerror = null;51 },52 teardown: function () {53 var store = this.store;54 if (store) {55 store.close();56 }57 djstest.wait(function (done) {58 djstest.cleanStoreOnIndexedDb([store], done);59 });60 // Restore QUnit's onerror handler.61 window.onerror = oldWindowOnError;62 }63 });64 djstest.addTest(function testIndexedDBStoreConstructor() {65 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());66 djstest.assertAreEqual(store.name, getCurrentStoreName());67 djstest.assertAreEqual(store.mechanism, "indexeddb");68 djstest.done();69 });70 djstest.addTest(function testIndexedDBStoreAddGet() {71 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());72 store.add("key", "value", function (key, value) {73 djstest.assertAreEqual(key, "key");74 djstest.assertAreEqual(value, "value");75 store.read("key", function (key, value) {76 djstest.assertAreEqual(key, "key");77 djstest.assertAreEqual(value, "value");78 djstest.done();79 }, unexpectedError);80 }, unexpectedError);81 });82 djstest.addTest(function testIndexedDBStoreAddUpdateGet() {83 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());84 store.add("key", "value", function (key, value) {85 store.update("key", "value2", function (key, value) {86 djstest.assertAreEqual(key, "key");87 djstest.assertAreEqual(value, "value2");88 store.read("key", function (key, value) {89 djstest.assertAreEqual(key, "key");90 djstest.assertAreEqual(value, "value2");91 djstest.done();92 }, unexpectedError);93 }, unexpectedError);94 }, unexpectedError);95 });96 djstest.addTest(function testIndexedDBStoreAddOrUpdateGet() {97 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());98 store.addOrUpdate("key", "value", function (key, value) {99 djstest.assertAreEqual(key, "key");100 djstest.assertAreEqual(value, "value");101 store.addOrUpdate("key", "value2", function (key, value) {102 djstest.assertAreEqual(key, "key");103 djstest.assertAreEqual(value, "value2");104 store.read("key", function (key, value) {105 djstest.assertAreEqual(key, "key");106 djstest.assertAreEqual(value, "value2");107 djstest.done();108 }, unexpectedError);109 }, unexpectedError);110 }, unexpectedError);111 });112 djstest.addTest(function testIndexedDBStoreAddRemoveContains() {113 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());114 store.add("key", "value", function (key, value) {115 store.contains("key", function (result) {116 djstest.assert(result);117 store.remove("key", function () {118 djstest.pass("key removed");119 store.contains("key", function (result) {120 djstest.assert(!result);121 djstest.done();122 }, unexpectedError);123 }, unexpectedError);124 }, unexpectedError);125 }, unexpectedError);126 });127 djstest.addTest(function testIndexedDBStoreAddConsecutiveGetAllKeys() {128 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());129 store.add("key", "value", function (key, value) {130 store.add("key2", "value2", function (key, value) {131 store.add("key3", "value3", function (key, value) {132 store.getAllKeys(function (keys) {133 djstest.assertAreEqualDeep(keys, ["key", "key2", "key3"]);134 djstest.done();135 }, unexpectedError);136 }, unexpectedError);137 }, unexpectedError);138 }, unexpectedError);139 });140 djstest.addTest(function testIndexedDBStoreAddArrayClear() {141 var addedKeys = ["key", "key2", "key3"];142 var addedValues = ["value", "value2", "value3"];143 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());144 store.add(addedKeys, addedValues, function (keys, values) {145 djstest.assertAreEqualDeep(keys, addedKeys);146 djstest.assertAreEqualDeep(values, addedValues);147 store.clear(function () {148 store.getAllKeys(function (keys) {149 djstest.assertAreEqualDeep(keys, []);150 djstest.done();151 }, unexpectedError);152 }, unexpectedError);153 }, unexpectedError);154 });155 djstest.addTest(function testIndexedDBStoreAddArrayUpdateArrayGetArray() {156 var addedKeys = ["key", "key2", "key3"];157 var addedValues = ["value", "value2", "value3"];158 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());159 store.add(addedKeys, addedValues, function (keys, values) {160 djstest.assertAreEqualDeep(keys, addedKeys);161 djstest.assertAreEqualDeep(values, addedValues);162 var updatedKeys = ["key", "key3"];163 var updatedValues = ["newValue", "newValue3"];164 store.update(updatedKeys, updatedValues, function (keys, values) {165 djstest.assertAreEqualDeep(keys, updatedKeys);166 djstest.assertAreEqualDeep(values, updatedValues);167 store.read(addedKeys, function (keys, values) {168 djstest.assertAreEqualDeep(keys, ["key", "key2", "key3"]);169 djstest.assertAreEqualDeep(values, ["newValue", "value2", "newValue3"]);170 djstest.done();171 }, unexpectedError);172 }, unexpectedError);173 }, unexpectedError);174 });175 djstest.addTest(function testIndexedDBStoreAddOrUpdateArrayGetArray() {176 var expectedKeys = ["key", "key2", "key3"];177 var expectedValues = ["value", "value2", "value3"];178 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());179 store.add("key2", "value", function (key, value) {180 store.addOrUpdate(expectedKeys, expectedValues, function (keys, values) {181 djstest.assertAreEqualDeep(keys, expectedKeys);182 djstest.assertAreEqualDeep(values, expectedValues);183 store.read(keys, function (keys, values) {184 djstest.assertAreEqualDeep(values, expectedValues);185 djstest.done();186 }, unexpectedError);187 }, unexpectedError);188 }, unexpectedError);189 });190 djstest.addTest(function testIndexedDBStoreAddDuplicate() {191 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());192 store.add("key", "value", function (key, value) {193 store.add("key", "value2", unexpectedSuccess, function (err) {194 djstest.pass("Error callback called as expected");195 djstest.done();196 });197 }, unexpectedError);198 });199 djstest.addTest(function testIndexedDBStoreAddArrayDuplicate() {200 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());201 store.add(["key", "key2", "key"], ["value", "value2", "value3"], unexpectedSuccess, function (err) {202 djstest.pass("Error callback called as expected");203 djstest.done();204 });205 });206 djstest.addTest(function testIndexedDBStoreGetArrayNonExistent() {207 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());208 store.add("key", "value", function (key, value) {209 store.read(["key", "badkey"], function (keys, values) {210 djstest.assertAreEqualDeep(keys, ["key", "badkey"]);211 djstest.assertAreEqualDeep(values, ["value", undefined]);212 djstest.done();213 }, unexpectedError);214 });215 });216 djstest.addTest(function testIndexedDBStoreUpdateNonExistent() {217 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());218 store.update("badkey", "badvalue", unexpectedSuccess, function (err) {219 djstest.pass("Error callback called as expected");220 djstest.done();221 });222 });223 djstest.addTest(function testIndexedDBStoreUpdateArrayNonExistent() {224 var store = this.store = window.odatajs.store.IndexedDBStore.create(getCurrentStoreName());225 store.add("key", "value", function (key, value) {226 store.update(["key", "badkey"], ["value", "badvalue"], unexpectedSuccess, function (err) {227 djstest.pass("Error callback called as expected");228 store.read("key", function (key, value) {229 djstest.assertAreEqual(value, "value", "value was not changed");230 djstest.done();231 }, unexpectedError);232 });233 }, unexpectedError);234 });235 }236 // DATAJS INTERNAL END...

Full Screen

Full Screen

token_model.py

Source:token_model.py Github

copy

Full Screen

1# Licensed under the Apache License, Version 2.0 (the "License"); you may2# not use this file except in compliance with the License. You may obtain3# a copy of the License at4#5# http://www.apache.org/licenses/LICENSE-2.06#7# Unless required by applicable law or agreed to in writing, software8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the10# License for the specific language governing permissions and limitations11# under the License.12"""Unified in-memory token model."""13from oslo_utils import reflection14from oslo_utils import timeutils15import six16import keystone.conf17from keystone import exception18from keystone.federation import constants19from keystone.i18n import _20CONF = keystone.conf.CONF21# supported token versions22V2 = 'v2.0'23V3 = 'v3.0'24VERSIONS = frozenset([V2, V3])25def _parse_and_normalize_time(time_data):26 if isinstance(time_data, six.string_types):27 time_data = timeutils.parse_isotime(time_data)28 return timeutils.normalize_time(time_data)29class KeystoneToken(dict):30 """An in-memory representation that unifies v2 and v3 tokens."""31 # TODO(morganfainberg): Align this in-memory representation with the32 # objects in keystoneclient. This object should be eventually updated33 # to be the source of token data with the ability to emit any version34 # of the token instead of only consuming the token dict and providing35 # property accessors for the underlying data.36 def __init__(self, token_id, token_data):37 self.token_data = token_data38 self.token_id = token_id39 try:40 super(KeystoneToken, self).__init__(**token_data['token'])41 except KeyError:42 raise exception.UnsupportedTokenVersionException()43 self.token_id = token_id44 if self.project_scoped and self.domain_scoped:45 raise exception.UnexpectedError(_('Found invalid token: scoped to '46 'both project and domain.'))47 def __repr__(self):48 """Return string representation of KeystoneToken."""49 desc = ('<%(type)s (audit_id=%(audit_id)s, '50 'audit_chain_id=%(audit_chain_id)s) at %(loc)s>')51 self_cls_name = reflection.get_class_name(self,52 fully_qualified=False)53 return desc % {'type': self_cls_name,54 'audit_id': self.audit_id,55 'audit_chain_id': self.audit_chain_id,56 'loc': hex(id(self))}57 @property58 def expires(self):59 return _parse_and_normalize_time(self['expires_at'])60 @property61 def issued(self):62 return _parse_and_normalize_time(self['issued_at'])63 @property64 def audit_id(self):65 return self.get('audit_ids', [None])[0]66 @property67 def audit_chain_id(self):68 return self.get('audit_ids', [None])[-1]69 @property70 def auth_token(self):71 return self.token_id72 @property73 def user_id(self):74 return self['user']['id']75 @property76 def user_name(self):77 return self['user']['name']78 @property79 def user_domain_name(self):80 try:81 return self['user']['domain']['name']82 except KeyError: # nosec83 # Do not raise KeyError, raise UnexpectedError84 pass85 raise exception.UnexpectedError()86 @property87 def user_password_expires_at(self):88 try:89 return self['user']['password_expires_at']90 except KeyError:91 # Do not raise KeyError, raise UnexpectedError92 pass93 raise exception.UnexpectedError()94 @property95 def user_domain_id(self):96 try:97 return self['user']['domain']['id']98 except KeyError: # nosec99 # Do not raise KeyError, raise UnexpectedError100 pass101 raise exception.UnexpectedError()102 @property103 def domain_id(self):104 try:105 return self['domain']['id']106 except KeyError:107 # Do not raise KeyError, raise UnexpectedError108 raise exception.UnexpectedError()109 @property110 def domain_name(self):111 try:112 return self['domain']['name']113 except KeyError:114 # Do not raise KeyError, raise UnexpectedError115 raise exception.UnexpectedError()116 @property117 def project_id(self):118 try:119 return self['project']['id']120 except KeyError:121 # Do not raise KeyError, raise UnexpectedError122 raise exception.UnexpectedError()123 @property124 def project_name(self):125 try:126 return self['project']['name']127 except KeyError:128 # Do not raise KeyError, raise UnexpectedError129 raise exception.UnexpectedError()130 @property131 def project_domain_id(self):132 try:133 return self['project']['domain']['id']134 except KeyError: # nosec135 # Do not raise KeyError, raise UnexpectedError136 pass137 raise exception.UnexpectedError()138 @property139 def project_domain_name(self):140 try:141 return self['project']['domain']['name']142 except KeyError: # nosec143 # Do not raise KeyError, raise UnexpectedError144 pass145 raise exception.UnexpectedError()146 @property147 def is_domain(self):148 if 'is_domain' in self:149 return self['is_domain']150 return False151 @property152 def project_scoped(self):153 return 'project' in self154 @property155 def domain_scoped(self):156 return 'domain' in self157 @property158 def scoped(self):159 return self.project_scoped or self.domain_scoped160 @property161 def is_admin_project(self):162 if self.domain_scoped:163 # Currently, domain scoped tokens cannot act as is_admin_project164 return False165 # True gets returned by default for compatibility with older versions166 # TODO(henry-nash): This seems inherently dangerous, and we should167 # investigate how we can default this to False.168 return self.get('is_admin_project', True)169 @property170 def trust_id(self):171 return self.get('OS-TRUST:trust', {}).get('id')172 @property173 def trust_scoped(self):174 return 'OS-TRUST:trust' in self175 @property176 def trustee_user_id(self):177 return self.get('OS-TRUST:trust', {}).get('trustee_user_id')178 @property179 def trustor_user_id(self):180 return self.get('OS-TRUST:trust', {}).get('trustor_user_id')181 @property182 def trust_impersonation(self):183 return self.get('OS-TRUST:trust', {}).get('impersonation')184 @property185 def oauth_scoped(self):186 return 'OS-OAUTH1' in self187 @property188 def oauth_access_token_id(self):189 if self.oauth_scoped:190 return self['OS-OAUTH1']['access_token_id']191 return None192 @property193 def oauth_consumer_id(self):194 if self.oauth_scoped:195 return self['OS-OAUTH1']['consumer_id']196 return None197 @property198 def role_ids(self):199 return [r['id'] for r in self.get('roles', [])]200 @property201 def role_names(self):202 return [r['name'] for r in self.get('roles', [])]203 @property204 def bind(self):205 return self.get('bind')206 @property207 def is_federated_user(self):208 try:209 return constants.FEDERATION in self['user']210 except KeyError:211 raise exception.UnexpectedError()212 @property213 def federation_group_ids(self):214 if self.is_federated_user:215 try:216 groups = self['user'][constants.FEDERATION].get('groups', [])217 return [g['id'] for g in groups]218 except KeyError:219 raise exception.UnexpectedError()220 return []221 @property222 def federation_idp_id(self):223 if self.is_federated_user:224 return (225 self['user'][constants.FEDERATION]['identity_provider']['id']226 )227 @property228 def federation_protocol_id(self):229 if self.is_federated_user:230 return self['user'][constants.FEDERATION]['protocol']['id']231 return None232 @property233 def metadata(self):234 return self.get('metadata', {})235 @property236 def methods(self):...

Full Screen

Full Screen

template-tag-spacing.js

Source:template-tag-spacing.js Github

copy

Full Screen

1/**2 * @fileoverview Tests for template-tag-spacing rule.3 * @author Jonathan Wilsson4 */5"use strict";6//------------------------------------------------------------------------------7// Requirements8//------------------------------------------------------------------------------9const rule = require("../../../lib/rules/template-tag-spacing"),10 { RuleTester } = require("../../../lib/rule-tester");11//------------------------------------------------------------------------------12// Tests13//------------------------------------------------------------------------------14const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } });15const unexpectedError = { messageId: "unexpected" };16const missingError = { messageId: "missing" };17ruleTester.run("template-tag-spacing", rule, {18 valid: [19 "tag`name`",20 { code: "tag`name`", options: ["never"] },21 { code: "tag `name`", options: ["always"] },22 "tag`hello ${name}`",23 { code: "tag`hello ${name}`", options: ["never"] },24 { code: "tag `hello ${name}`", options: ["always"] },25 "tag/*here's a comment*/`Hello world`",26 { code: "tag/*here's a comment*/`Hello world`", options: ["never"] },27 { code: "tag /*here's a comment*/`Hello world`", options: ["always"] },28 { code: "tag/*here's a comment*/ `Hello world`", options: ["always"] },29 "new tag`name`",30 { code: "new tag`name`", options: ["never"] },31 { code: "new tag `name`", options: ["always"] },32 "new tag`hello ${name}`",33 { code: "new tag`hello ${name}`", options: ["never"] },34 { code: "new tag `hello ${name}`", options: ["always"] },35 "(tag)`name`",36 { code: "(tag)`name`", options: ["never"] },37 { code: "(tag) `name`", options: ["always"] },38 "(tag)`hello ${name}`",39 { code: "(tag)`hello ${name}`", options: ["never"] },40 { code: "(tag) `hello ${name}`", options: ["always"] },41 "new (tag)`name`",42 { code: "new (tag)`name`", options: ["never"] },43 { code: "new (tag) `name`", options: ["always"] },44 "new (tag)`hello ${name}`",45 { code: "new (tag)`hello ${name}`", options: ["never"] },46 { code: "new (tag) `hello ${name}`", options: ["always"] }47 ],48 invalid: [49 {50 code: "tag `name`",51 output: "tag`name`",52 errors: [unexpectedError]53 },54 {55 code: "tag `name`",56 output: "tag`name`",57 options: ["never"],58 errors: [unexpectedError]59 },60 {61 code: "tag`name`",62 output: "tag `name`",63 options: ["always"],64 errors: [missingError]65 },66 {67 code: "tag /*here's a comment*/`Hello world`",68 output: "tag/*here's a comment*/`Hello world`",69 options: ["never"],70 errors: [unexpectedError]71 },72 {73 code: "tag/*here's a comment*/ `Hello world`",74 output: "tag/*here's a comment*/`Hello world`",75 options: ["never"],76 errors: [unexpectedError]77 },78 {79 code: "tag/*here's a comment*/`Hello world`",80 output: "tag /*here's a comment*/`Hello world`",81 options: ["always"],82 errors: [missingError]83 },84 {85 code: "tag // here's a comment \n`bar`",86 output: null,87 errors: [unexpectedError]88 },89 {90 code: "tag // here's a comment \n`bar`",91 output: null,92 options: ["never"],93 errors: [unexpectedError]94 },95 {96 code: "tag `hello ${name}`",97 output: "tag`hello ${name}`",98 errors: [unexpectedError]99 },100 {101 code: "tag `hello ${name}`",102 output: "tag`hello ${name}`",103 options: ["never"],104 errors: [unexpectedError]105 },106 {107 code: "tag`hello ${name}`",108 output: "tag `hello ${name}`",109 options: ["always"],110 errors: [missingError]111 },112 {113 code: "new tag `name`",114 output: "new tag`name`",115 errors: [unexpectedError]116 },117 {118 code: "new tag `name`",119 output: "new tag`name`",120 options: ["never"],121 errors: [unexpectedError]122 },123 {124 code: "new tag`name`",125 output: "new tag `name`",126 options: ["always"],127 errors: [missingError]128 },129 {130 code: "new tag `hello ${name}`",131 output: "new tag`hello ${name}`",132 errors: [unexpectedError]133 },134 {135 code: "new tag `hello ${name}`",136 output: "new tag`hello ${name}`",137 options: ["never"],138 errors: [unexpectedError]139 },140 {141 code: "new tag`hello ${name}`",142 output: "new tag `hello ${name}`",143 options: ["always"],144 errors: [missingError]145 },146 {147 code: "(tag) `name`",148 output: "(tag)`name`",149 errors: [unexpectedError]150 },151 {152 code: "(tag) `name`",153 output: "(tag)`name`",154 options: ["never"],155 errors: [unexpectedError]156 },157 {158 code: "(tag)`name`",159 output: "(tag) `name`",160 options: ["always"],161 errors: [missingError]162 },163 {164 code: "(tag) `hello ${name}`",165 output: "(tag)`hello ${name}`",166 errors: [unexpectedError]167 },168 {169 code: "(tag) `hello ${name}`",170 output: "(tag)`hello ${name}`",171 options: ["never"],172 errors: [unexpectedError]173 },174 {175 code: "(tag)`hello ${name}`",176 output: "(tag) `hello ${name}`",177 options: ["always"],178 errors: [missingError]179 },180 {181 code: "new (tag) `name`",182 output: "new (tag)`name`",183 errors: [unexpectedError]184 },185 {186 code: "new (tag) `name`",187 output: "new (tag)`name`",188 options: ["never"],189 errors: [unexpectedError]190 },191 {192 code: "new (tag)`name`",193 output: "new (tag) `name`",194 options: ["always"],195 errors: [missingError]196 },197 {198 code: "new (tag) `hello ${name}`",199 output: "new (tag)`hello ${name}`",200 errors: [unexpectedError]201 },202 {203 code: "new (tag) `hello ${name}`",204 output: "new (tag)`hello ${name}`",205 options: ["never"],206 errors: [unexpectedError]207 },208 {209 code: "new (tag)`hello ${name}`",210 output: "new (tag) `hello ${name}`",211 options: ["always"],212 errors: [missingError]213 }214 ]...

Full Screen

Full Screen

UnexpectedError.js

Source:UnexpectedError.js Github

copy

Full Screen

1/**2 * Email Validator3 * All timeouts are set in seconds with nanosecond precision. For example, 1.505402 is 1 second, 505 milliseconds and 402 microseconds. 4 *5 * The version of the OpenAPI document: 0.0.16 * 7 *8 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).9 * https://openapi-generator.tech10 * Do not edit the class manually.11 *12 */13import ApiClient from '../ApiClient';14/**15 * The UnexpectedError model module.16 * @module model/UnexpectedError17 * @version 0.0.118 */19class UnexpectedError {20 /**21 * Constructs a new <code>UnexpectedError</code>.22 * @alias module:model/UnexpectedError23 */24 constructor() { 25 26 UnexpectedError.initialize(this);27 }28 /**29 * Initializes the fields of this object.30 * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).31 * Only for internal use.32 */33 static initialize(obj) { 34 }35 /**36 * Constructs a <code>UnexpectedError</code> from a plain JavaScript object, optionally creating a new instance.37 * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.38 * @param {Object} data The plain JavaScript object bearing properties of interest.39 * @param {module:model/UnexpectedError} obj Optional instance to populate.40 * @return {module:model/UnexpectedError} The populated <code>UnexpectedError</code> instance.41 */42 static constructFromObject(data, obj) {43 if (data) {44 obj = obj || new UnexpectedError();45 if (data.hasOwnProperty('code')) {46 obj['code'] = ApiClient.convertToType(data['code'], 'Number');47 }48 if (data.hasOwnProperty('message')) {49 obj['message'] = ApiClient.convertToType(data['message'], 'String');50 }51 if (data.hasOwnProperty('details')) {52 obj['details'] = ApiClient.convertToType(data['details'], {'String': Object});53 }54 }55 return obj;56 }57}58/**59 * @member {Number} code60 */61UnexpectedError.prototype['code'] = undefined;62/**63 * @member {String} message64 */65UnexpectedError.prototype['message'] = undefined;66/**67 * @member {Object.<String, Object>} details68 */69UnexpectedError.prototype['details'] = undefined;...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run prospector automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful