@itentialopensource/adapter-netbox 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/adapter.js +815 -0
- package/entities/Dcim/action.json +182 -0
- package/entities/Dcim/mockdatafiles/getDcimLocations-default.json +688 -0
- package/entities/Dcim/schema.json +82 -19
- package/package.json +1 -1
- package/pronghorn.json +2642 -642
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +7 -7
- package/test/integration/adapterTestIntegration.js +253 -0
- package/test/unit/adapterTestUnit.js +261 -0
|
Binary file
|
package/report/adapterInfo.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"configLines":
|
|
2
|
+
"version": "0.8.0",
|
|
3
|
+
"configLines": 46191,
|
|
4
4
|
"scriptLines": 1707,
|
|
5
|
-
"codeLines":
|
|
6
|
-
"testLines":
|
|
7
|
-
"testCases":
|
|
8
|
-
"totalCodeLines":
|
|
9
|
-
"wfTasks":
|
|
5
|
+
"codeLines": 35506,
|
|
6
|
+
"testLines": 27265,
|
|
7
|
+
"testCases": 1353,
|
|
8
|
+
"totalCodeLines": 64478,
|
|
9
|
+
"wfTasks": 411
|
|
10
10
|
}
|
|
@@ -12250,5 +12250,258 @@ describe('[integration] Netbox Adapter Test', () => {
|
|
|
12250
12250
|
}
|
|
12251
12251
|
}).timeout(attemptTimeout);
|
|
12252
12252
|
});
|
|
12253
|
+
|
|
12254
|
+
describe('#getDcimLocations - errors', () => {
|
|
12255
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
12256
|
+
try {
|
|
12257
|
+
a.getDcimLocations(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
12258
|
+
try {
|
|
12259
|
+
if (stub) {
|
|
12260
|
+
runCommonAsserts(data, error);
|
|
12261
|
+
assert.equal(1, data.response.count);
|
|
12262
|
+
assert.equal('string', data.response.next);
|
|
12263
|
+
assert.equal('string', data.response.previous);
|
|
12264
|
+
assert.equal(true, Array.isArray(data.response.results));
|
|
12265
|
+
} else {
|
|
12266
|
+
runCommonAsserts(data, error);
|
|
12267
|
+
}
|
|
12268
|
+
saveMockData('Dcim', 'getDcimLocations', 'default', data);
|
|
12269
|
+
done();
|
|
12270
|
+
} catch (err) {
|
|
12271
|
+
log.error(`Test Failure: ${err}`);
|
|
12272
|
+
done(err);
|
|
12273
|
+
}
|
|
12274
|
+
});
|
|
12275
|
+
} catch (error) {
|
|
12276
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12277
|
+
done(error);
|
|
12278
|
+
}
|
|
12279
|
+
}).timeout(attemptTimeout);
|
|
12280
|
+
});
|
|
12281
|
+
|
|
12282
|
+
const dcimPostDcimLocationsBodyParam = {
|
|
12283
|
+
name: 'string',
|
|
12284
|
+
slug: 'string',
|
|
12285
|
+
site: 1
|
|
12286
|
+
};
|
|
12287
|
+
describe('#postDcimLocations - errors', () => {
|
|
12288
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12289
|
+
try {
|
|
12290
|
+
a.postDcimLocations(dcimPostDcimLocationsBodyParam, (data, error) => {
|
|
12291
|
+
try {
|
|
12292
|
+
if (stub) {
|
|
12293
|
+
const displayE = 'Error 400 received on request';
|
|
12294
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12295
|
+
} else {
|
|
12296
|
+
runCommonAsserts(data, error);
|
|
12297
|
+
}
|
|
12298
|
+
saveMockData('Dcim', 'postDcimLocations', 'default', data);
|
|
12299
|
+
done();
|
|
12300
|
+
} catch (err) {
|
|
12301
|
+
log.error(`Test Failure: ${err}`);
|
|
12302
|
+
done(err);
|
|
12303
|
+
}
|
|
12304
|
+
});
|
|
12305
|
+
} catch (error) {
|
|
12306
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12307
|
+
done(error);
|
|
12308
|
+
}
|
|
12309
|
+
}).timeout(attemptTimeout);
|
|
12310
|
+
});
|
|
12311
|
+
|
|
12312
|
+
const dcimPutDcimLocationsBodyParam = {
|
|
12313
|
+
name: 'string',
|
|
12314
|
+
slug: 'string',
|
|
12315
|
+
site: 6
|
|
12316
|
+
};
|
|
12317
|
+
describe('#putDcimLocations - errors', () => {
|
|
12318
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12319
|
+
try {
|
|
12320
|
+
a.putDcimLocations(dcimPutDcimLocationsBodyParam, (data, error) => {
|
|
12321
|
+
try {
|
|
12322
|
+
if (stub) {
|
|
12323
|
+
const displayE = 'Error 400 received on request';
|
|
12324
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12325
|
+
} else {
|
|
12326
|
+
runCommonAsserts(data, error);
|
|
12327
|
+
}
|
|
12328
|
+
saveMockData('Dcim', 'putDcimLocations', 'default', data);
|
|
12329
|
+
done();
|
|
12330
|
+
} catch (err) {
|
|
12331
|
+
log.error(`Test Failure: ${err}`);
|
|
12332
|
+
done(err);
|
|
12333
|
+
}
|
|
12334
|
+
});
|
|
12335
|
+
} catch (error) {
|
|
12336
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12337
|
+
done(error);
|
|
12338
|
+
}
|
|
12339
|
+
}).timeout(attemptTimeout);
|
|
12340
|
+
});
|
|
12341
|
+
|
|
12342
|
+
const dcimPatchDcimLocationsBodyParam = {
|
|
12343
|
+
name: 'string',
|
|
12344
|
+
slug: 'string',
|
|
12345
|
+
site: 7
|
|
12346
|
+
};
|
|
12347
|
+
describe('#patchDcimLocations - errors', () => {
|
|
12348
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12349
|
+
try {
|
|
12350
|
+
a.patchDcimLocations(dcimPatchDcimLocationsBodyParam, (data, error) => {
|
|
12351
|
+
try {
|
|
12352
|
+
if (stub) {
|
|
12353
|
+
const displayE = 'Error 400 received on request';
|
|
12354
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12355
|
+
} else {
|
|
12356
|
+
runCommonAsserts(data, error);
|
|
12357
|
+
}
|
|
12358
|
+
saveMockData('Dcim', 'patchDcimLocations', 'default', data);
|
|
12359
|
+
done();
|
|
12360
|
+
} catch (err) {
|
|
12361
|
+
log.error(`Test Failure: ${err}`);
|
|
12362
|
+
done(err);
|
|
12363
|
+
}
|
|
12364
|
+
});
|
|
12365
|
+
} catch (error) {
|
|
12366
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12367
|
+
done(error);
|
|
12368
|
+
}
|
|
12369
|
+
}).timeout(attemptTimeout);
|
|
12370
|
+
});
|
|
12371
|
+
|
|
12372
|
+
describe('#deleteDcimLocations - errors', () => {
|
|
12373
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12374
|
+
try {
|
|
12375
|
+
a.deleteDcimLocations((data, error) => {
|
|
12376
|
+
try {
|
|
12377
|
+
if (stub) {
|
|
12378
|
+
const displayE = 'Error 400 received on request';
|
|
12379
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12380
|
+
} else {
|
|
12381
|
+
runCommonAsserts(data, error);
|
|
12382
|
+
}
|
|
12383
|
+
saveMockData('Dcim', 'deleteDcimLocations', 'default', data);
|
|
12384
|
+
done();
|
|
12385
|
+
} catch (err) {
|
|
12386
|
+
log.error(`Test Failure: ${err}`);
|
|
12387
|
+
done(err);
|
|
12388
|
+
}
|
|
12389
|
+
});
|
|
12390
|
+
} catch (error) {
|
|
12391
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12392
|
+
done(error);
|
|
12393
|
+
}
|
|
12394
|
+
}).timeout(attemptTimeout);
|
|
12395
|
+
});
|
|
12396
|
+
|
|
12397
|
+
describe('#getDcimLocationsId - errors', () => {
|
|
12398
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12399
|
+
try {
|
|
12400
|
+
a.getDcimLocationsId(555, (data, error) => {
|
|
12401
|
+
try {
|
|
12402
|
+
if (stub) {
|
|
12403
|
+
const displayE = 'Error 400 received on request';
|
|
12404
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12405
|
+
} else {
|
|
12406
|
+
runCommonAsserts(data, error);
|
|
12407
|
+
}
|
|
12408
|
+
saveMockData('Dcim', 'getDcimLocationsId', 'default', data);
|
|
12409
|
+
done();
|
|
12410
|
+
} catch (err) {
|
|
12411
|
+
log.error(`Test Failure: ${err}`);
|
|
12412
|
+
done(err);
|
|
12413
|
+
}
|
|
12414
|
+
});
|
|
12415
|
+
} catch (error) {
|
|
12416
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12417
|
+
done(error);
|
|
12418
|
+
}
|
|
12419
|
+
}).timeout(attemptTimeout);
|
|
12420
|
+
});
|
|
12421
|
+
|
|
12422
|
+
const dcimPutDcimLocationsIdBodyParam = {
|
|
12423
|
+
name: 'string',
|
|
12424
|
+
slug: 'string',
|
|
12425
|
+
site: 2
|
|
12426
|
+
};
|
|
12427
|
+
describe('#putDcimLocationsId - errors', () => {
|
|
12428
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12429
|
+
try {
|
|
12430
|
+
a.putDcimLocationsId(555, dcimPutDcimLocationsIdBodyParam, (data, error) => {
|
|
12431
|
+
try {
|
|
12432
|
+
if (stub) {
|
|
12433
|
+
const displayE = 'Error 400 received on request';
|
|
12434
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12435
|
+
} else {
|
|
12436
|
+
runCommonAsserts(data, error);
|
|
12437
|
+
}
|
|
12438
|
+
saveMockData('Dcim', 'putDcimLocationsId', 'default', data);
|
|
12439
|
+
done();
|
|
12440
|
+
} catch (err) {
|
|
12441
|
+
log.error(`Test Failure: ${err}`);
|
|
12442
|
+
done(err);
|
|
12443
|
+
}
|
|
12444
|
+
});
|
|
12445
|
+
} catch (error) {
|
|
12446
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12447
|
+
done(error);
|
|
12448
|
+
}
|
|
12449
|
+
}).timeout(attemptTimeout);
|
|
12450
|
+
});
|
|
12451
|
+
|
|
12452
|
+
const dcimPatchDcimLocationsIdBodyParam = {
|
|
12453
|
+
name: 'string',
|
|
12454
|
+
slug: 'string',
|
|
12455
|
+
site: 9
|
|
12456
|
+
};
|
|
12457
|
+
describe('#patchDcimLocationsId - errors', () => {
|
|
12458
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12459
|
+
try {
|
|
12460
|
+
a.patchDcimLocationsId(555, dcimPatchDcimLocationsIdBodyParam, (data, error) => {
|
|
12461
|
+
try {
|
|
12462
|
+
if (stub) {
|
|
12463
|
+
const displayE = 'Error 400 received on request';
|
|
12464
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12465
|
+
} else {
|
|
12466
|
+
runCommonAsserts(data, error);
|
|
12467
|
+
}
|
|
12468
|
+
saveMockData('Dcim', 'patchDcimLocationsId', 'default', data);
|
|
12469
|
+
done();
|
|
12470
|
+
} catch (err) {
|
|
12471
|
+
log.error(`Test Failure: ${err}`);
|
|
12472
|
+
done(err);
|
|
12473
|
+
}
|
|
12474
|
+
});
|
|
12475
|
+
} catch (error) {
|
|
12476
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12477
|
+
done(error);
|
|
12478
|
+
}
|
|
12479
|
+
}).timeout(attemptTimeout);
|
|
12480
|
+
});
|
|
12481
|
+
|
|
12482
|
+
describe('#deleteDcimLocationsId - errors', () => {
|
|
12483
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
12484
|
+
try {
|
|
12485
|
+
a.deleteDcimLocationsId(555, (data, error) => {
|
|
12486
|
+
try {
|
|
12487
|
+
if (stub) {
|
|
12488
|
+
const displayE = 'Error 400 received on request';
|
|
12489
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-netbox-connectorRest-handleEndResponse', displayE);
|
|
12490
|
+
} else {
|
|
12491
|
+
runCommonAsserts(data, error);
|
|
12492
|
+
}
|
|
12493
|
+
saveMockData('Dcim', 'deleteDcimLocationsId', 'default', data);
|
|
12494
|
+
done();
|
|
12495
|
+
} catch (err) {
|
|
12496
|
+
log.error(`Test Failure: ${err}`);
|
|
12497
|
+
done(err);
|
|
12498
|
+
}
|
|
12499
|
+
});
|
|
12500
|
+
} catch (error) {
|
|
12501
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12502
|
+
done(error);
|
|
12503
|
+
}
|
|
12504
|
+
}).timeout(attemptTimeout);
|
|
12505
|
+
});
|
|
12253
12506
|
});
|
|
12254
12507
|
});
|
|
@@ -13361,5 +13361,266 @@ describe('[unit] Netbox Adapter Test', () => {
|
|
|
13361
13361
|
}
|
|
13362
13362
|
}).timeout(attemptTimeout);
|
|
13363
13363
|
});
|
|
13364
|
+
|
|
13365
|
+
describe('#getDcimLocations - errors', () => {
|
|
13366
|
+
it('should have a getDcimLocations function', (done) => {
|
|
13367
|
+
try {
|
|
13368
|
+
assert.equal(true, typeof a.getDcimLocations === 'function');
|
|
13369
|
+
done();
|
|
13370
|
+
} catch (error) {
|
|
13371
|
+
log.error(`Test Failure: ${error}`);
|
|
13372
|
+
done(error);
|
|
13373
|
+
}
|
|
13374
|
+
}).timeout(attemptTimeout);
|
|
13375
|
+
});
|
|
13376
|
+
|
|
13377
|
+
describe('#postDcimLocations - errors', () => {
|
|
13378
|
+
it('should have a postDcimLocations function', (done) => {
|
|
13379
|
+
try {
|
|
13380
|
+
assert.equal(true, typeof a.postDcimLocations === 'function');
|
|
13381
|
+
done();
|
|
13382
|
+
} catch (error) {
|
|
13383
|
+
log.error(`Test Failure: ${error}`);
|
|
13384
|
+
done(error);
|
|
13385
|
+
}
|
|
13386
|
+
}).timeout(attemptTimeout);
|
|
13387
|
+
it('should error if - missing data', (done) => {
|
|
13388
|
+
try {
|
|
13389
|
+
a.postDcimLocations(null, (data, error) => {
|
|
13390
|
+
try {
|
|
13391
|
+
const displayE = 'data is required';
|
|
13392
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-postDcimLocations', displayE);
|
|
13393
|
+
done();
|
|
13394
|
+
} catch (err) {
|
|
13395
|
+
log.error(`Test Failure: ${err}`);
|
|
13396
|
+
done(err);
|
|
13397
|
+
}
|
|
13398
|
+
});
|
|
13399
|
+
} catch (error) {
|
|
13400
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13401
|
+
done(error);
|
|
13402
|
+
}
|
|
13403
|
+
}).timeout(attemptTimeout);
|
|
13404
|
+
});
|
|
13405
|
+
|
|
13406
|
+
describe('#putDcimLocations - errors', () => {
|
|
13407
|
+
it('should have a putDcimLocations function', (done) => {
|
|
13408
|
+
try {
|
|
13409
|
+
assert.equal(true, typeof a.putDcimLocations === 'function');
|
|
13410
|
+
done();
|
|
13411
|
+
} catch (error) {
|
|
13412
|
+
log.error(`Test Failure: ${error}`);
|
|
13413
|
+
done(error);
|
|
13414
|
+
}
|
|
13415
|
+
}).timeout(attemptTimeout);
|
|
13416
|
+
it('should error if - missing data', (done) => {
|
|
13417
|
+
try {
|
|
13418
|
+
a.putDcimLocations(null, (data, error) => {
|
|
13419
|
+
try {
|
|
13420
|
+
const displayE = 'data is required';
|
|
13421
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-putDcimLocations', displayE);
|
|
13422
|
+
done();
|
|
13423
|
+
} catch (err) {
|
|
13424
|
+
log.error(`Test Failure: ${err}`);
|
|
13425
|
+
done(err);
|
|
13426
|
+
}
|
|
13427
|
+
});
|
|
13428
|
+
} catch (error) {
|
|
13429
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13430
|
+
done(error);
|
|
13431
|
+
}
|
|
13432
|
+
}).timeout(attemptTimeout);
|
|
13433
|
+
});
|
|
13434
|
+
|
|
13435
|
+
describe('#patchDcimLocations - errors', () => {
|
|
13436
|
+
it('should have a patchDcimLocations function', (done) => {
|
|
13437
|
+
try {
|
|
13438
|
+
assert.equal(true, typeof a.patchDcimLocations === 'function');
|
|
13439
|
+
done();
|
|
13440
|
+
} catch (error) {
|
|
13441
|
+
log.error(`Test Failure: ${error}`);
|
|
13442
|
+
done(error);
|
|
13443
|
+
}
|
|
13444
|
+
}).timeout(attemptTimeout);
|
|
13445
|
+
it('should error if - missing data', (done) => {
|
|
13446
|
+
try {
|
|
13447
|
+
a.patchDcimLocations(null, (data, error) => {
|
|
13448
|
+
try {
|
|
13449
|
+
const displayE = 'data is required';
|
|
13450
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-patchDcimLocations', displayE);
|
|
13451
|
+
done();
|
|
13452
|
+
} catch (err) {
|
|
13453
|
+
log.error(`Test Failure: ${err}`);
|
|
13454
|
+
done(err);
|
|
13455
|
+
}
|
|
13456
|
+
});
|
|
13457
|
+
} catch (error) {
|
|
13458
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13459
|
+
done(error);
|
|
13460
|
+
}
|
|
13461
|
+
}).timeout(attemptTimeout);
|
|
13462
|
+
});
|
|
13463
|
+
|
|
13464
|
+
describe('#deleteDcimLocations - errors', () => {
|
|
13465
|
+
it('should have a deleteDcimLocations function', (done) => {
|
|
13466
|
+
try {
|
|
13467
|
+
assert.equal(true, typeof a.deleteDcimLocations === 'function');
|
|
13468
|
+
done();
|
|
13469
|
+
} catch (error) {
|
|
13470
|
+
log.error(`Test Failure: ${error}`);
|
|
13471
|
+
done(error);
|
|
13472
|
+
}
|
|
13473
|
+
}).timeout(attemptTimeout);
|
|
13474
|
+
});
|
|
13475
|
+
|
|
13476
|
+
describe('#getDcimLocationsId - errors', () => {
|
|
13477
|
+
it('should have a getDcimLocationsId function', (done) => {
|
|
13478
|
+
try {
|
|
13479
|
+
assert.equal(true, typeof a.getDcimLocationsId === 'function');
|
|
13480
|
+
done();
|
|
13481
|
+
} catch (error) {
|
|
13482
|
+
log.error(`Test Failure: ${error}`);
|
|
13483
|
+
done(error);
|
|
13484
|
+
}
|
|
13485
|
+
}).timeout(attemptTimeout);
|
|
13486
|
+
it('should error if - missing id', (done) => {
|
|
13487
|
+
try {
|
|
13488
|
+
a.getDcimLocationsId(null, (data, error) => {
|
|
13489
|
+
try {
|
|
13490
|
+
const displayE = 'id is required';
|
|
13491
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-getDcimLocationsId', displayE);
|
|
13492
|
+
done();
|
|
13493
|
+
} catch (err) {
|
|
13494
|
+
log.error(`Test Failure: ${err}`);
|
|
13495
|
+
done(err);
|
|
13496
|
+
}
|
|
13497
|
+
});
|
|
13498
|
+
} catch (error) {
|
|
13499
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13500
|
+
done(error);
|
|
13501
|
+
}
|
|
13502
|
+
}).timeout(attemptTimeout);
|
|
13503
|
+
});
|
|
13504
|
+
|
|
13505
|
+
describe('#putDcimLocationsId - errors', () => {
|
|
13506
|
+
it('should have a putDcimLocationsId function', (done) => {
|
|
13507
|
+
try {
|
|
13508
|
+
assert.equal(true, typeof a.putDcimLocationsId === 'function');
|
|
13509
|
+
done();
|
|
13510
|
+
} catch (error) {
|
|
13511
|
+
log.error(`Test Failure: ${error}`);
|
|
13512
|
+
done(error);
|
|
13513
|
+
}
|
|
13514
|
+
}).timeout(attemptTimeout);
|
|
13515
|
+
it('should error if - missing id', (done) => {
|
|
13516
|
+
try {
|
|
13517
|
+
a.putDcimLocationsId(null, null, (data, error) => {
|
|
13518
|
+
try {
|
|
13519
|
+
const displayE = 'id is required';
|
|
13520
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-putDcimLocationsId', displayE);
|
|
13521
|
+
done();
|
|
13522
|
+
} catch (err) {
|
|
13523
|
+
log.error(`Test Failure: ${err}`);
|
|
13524
|
+
done(err);
|
|
13525
|
+
}
|
|
13526
|
+
});
|
|
13527
|
+
} catch (error) {
|
|
13528
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13529
|
+
done(error);
|
|
13530
|
+
}
|
|
13531
|
+
}).timeout(attemptTimeout);
|
|
13532
|
+
it('should error if - missing data', (done) => {
|
|
13533
|
+
try {
|
|
13534
|
+
a.putDcimLocationsId('fakeparam', null, (data, error) => {
|
|
13535
|
+
try {
|
|
13536
|
+
const displayE = 'data is required';
|
|
13537
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-putDcimLocationsId', displayE);
|
|
13538
|
+
done();
|
|
13539
|
+
} catch (err) {
|
|
13540
|
+
log.error(`Test Failure: ${err}`);
|
|
13541
|
+
done(err);
|
|
13542
|
+
}
|
|
13543
|
+
});
|
|
13544
|
+
} catch (error) {
|
|
13545
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13546
|
+
done(error);
|
|
13547
|
+
}
|
|
13548
|
+
}).timeout(attemptTimeout);
|
|
13549
|
+
});
|
|
13550
|
+
|
|
13551
|
+
describe('#patchDcimLocationsId - errors', () => {
|
|
13552
|
+
it('should have a patchDcimLocationsId function', (done) => {
|
|
13553
|
+
try {
|
|
13554
|
+
assert.equal(true, typeof a.patchDcimLocationsId === 'function');
|
|
13555
|
+
done();
|
|
13556
|
+
} catch (error) {
|
|
13557
|
+
log.error(`Test Failure: ${error}`);
|
|
13558
|
+
done(error);
|
|
13559
|
+
}
|
|
13560
|
+
}).timeout(attemptTimeout);
|
|
13561
|
+
it('should error if - missing id', (done) => {
|
|
13562
|
+
try {
|
|
13563
|
+
a.patchDcimLocationsId(null, null, (data, error) => {
|
|
13564
|
+
try {
|
|
13565
|
+
const displayE = 'id is required';
|
|
13566
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-patchDcimLocationsId', displayE);
|
|
13567
|
+
done();
|
|
13568
|
+
} catch (err) {
|
|
13569
|
+
log.error(`Test Failure: ${err}`);
|
|
13570
|
+
done(err);
|
|
13571
|
+
}
|
|
13572
|
+
});
|
|
13573
|
+
} catch (error) {
|
|
13574
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13575
|
+
done(error);
|
|
13576
|
+
}
|
|
13577
|
+
}).timeout(attemptTimeout);
|
|
13578
|
+
it('should error if - missing data', (done) => {
|
|
13579
|
+
try {
|
|
13580
|
+
a.patchDcimLocationsId('fakeparam', null, (data, error) => {
|
|
13581
|
+
try {
|
|
13582
|
+
const displayE = 'data is required';
|
|
13583
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-patchDcimLocationsId', displayE);
|
|
13584
|
+
done();
|
|
13585
|
+
} catch (err) {
|
|
13586
|
+
log.error(`Test Failure: ${err}`);
|
|
13587
|
+
done(err);
|
|
13588
|
+
}
|
|
13589
|
+
});
|
|
13590
|
+
} catch (error) {
|
|
13591
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13592
|
+
done(error);
|
|
13593
|
+
}
|
|
13594
|
+
}).timeout(attemptTimeout);
|
|
13595
|
+
});
|
|
13596
|
+
|
|
13597
|
+
describe('#deleteDcimLocationsId - errors', () => {
|
|
13598
|
+
it('should have a deleteDcimLocationsId function', (done) => {
|
|
13599
|
+
try {
|
|
13600
|
+
assert.equal(true, typeof a.deleteDcimLocationsId === 'function');
|
|
13601
|
+
done();
|
|
13602
|
+
} catch (error) {
|
|
13603
|
+
log.error(`Test Failure: ${error}`);
|
|
13604
|
+
done(error);
|
|
13605
|
+
}
|
|
13606
|
+
}).timeout(attemptTimeout);
|
|
13607
|
+
it('should error if - missing id', (done) => {
|
|
13608
|
+
try {
|
|
13609
|
+
a.deleteDcimLocationsId(null, (data, error) => {
|
|
13610
|
+
try {
|
|
13611
|
+
const displayE = 'id is required';
|
|
13612
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-netbox-adapter-deleteDcimLocationsId', displayE);
|
|
13613
|
+
done();
|
|
13614
|
+
} catch (err) {
|
|
13615
|
+
log.error(`Test Failure: ${err}`);
|
|
13616
|
+
done(err);
|
|
13617
|
+
}
|
|
13618
|
+
});
|
|
13619
|
+
} catch (error) {
|
|
13620
|
+
log.error(`Adapter Exception: ${error}`);
|
|
13621
|
+
done(error);
|
|
13622
|
+
}
|
|
13623
|
+
}).timeout(attemptTimeout);
|
|
13624
|
+
});
|
|
13364
13625
|
});
|
|
13365
13626
|
});
|