Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
9728d81e
Commit
9728d81e
authored
4 years ago
by
Robert Latta
Browse files
Options
Downloads
Patches
Plain Diff
added test for get_circuit_hierachy
parent
cd65dc46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/data/ims_circuit_hierarchy_data.json
+1016
-0
1016 additions, 0 deletions
test/data/ims_circuit_hierarchy_data.json
test/test_ims_data.py
+41
-1
41 additions, 1 deletion
test/test_ims_data.py
with
1057 additions
and
1 deletion
test/data/ims_circuit_hierarchy_data.json
0 → 100644
+
1016
−
0
View file @
9728d81e
[
{
"acquisitiondate"
:
null
,
"antennafeeders"
:
null
,
"bicableports"
:
null
,
"blocked"
:
0
,
"cableports"
:
null
,
"calculatedlength"
:
null
,
"carriercircuits"
:
[
{
"carriercircuit"
:
{
"acquisitiondate"
:
null
,
"antennafeeders"
:
null
,
"bicableports"
:
null
,
"blocked"
:
0
,
"cableports"
:
null
,
"calculatedlength"
:
null
,
"carriercircuits"
:
null
,
"channelreservations"
:
null
,
"circuitaliases"
:
null
,
"circuitattachments"
:
null
,
"circuitcoordinates"
:
null
,
"circuitcounts"
:
null
,
"circuitdomains"
:
null
,
"circuitmanagementsystems"
:
null
,
"circuitmergingrelatedcircuits"
:
null
,
"circuitprotectionprotections"
:
null
,
"circuitprotectionworkers"
:
null
,
"circuitrequestor"
:
""
,
"circuittypeid"
:
0
,
"coscircuits"
:
null
,
"createdate"
:
"2020-02-19T20:20:07"
,
"createuser"
:
null
,
"createuserid"
:
8338
,
"csc"
:
null
,
"cscid"
:
null
,
"customer"
:
null
,
"customerid"
:
57773
,
"ddfodfports"
:
null
,
"ddfodfpositionfromto"
:
null
,
"ddfodfpositions"
:
null
,
"deliverdate"
:
"2020-02-19T20:20:07"
,
"designref"
:
""
,
"dsls"
:
null
,
"errors"
:
null
,
"extrainfo"
:
""
,
"extrainfoimportant"
:
0
,
"fitstatus"
:
""
,
"floorplanlines"
:
null
,
"frameatms"
:
null
,
"framessizerequired"
:
null
,
"framing"
:
""
,
"geocircuitspiped"
:
null
,
"geodataisineditmode"
:
null
,
"geoworkersandprotections"
:
null
,
"haserrors"
:
false
,
"id"
:
660461
,
"internalporta"
:
null
,
"internalportaid"
:
null
,
"internalportb"
:
null
,
"internalportbid"
:
null
,
"internalports"
:
null
,
"inventorystatusid"
:
3
,
"ipranges"
:
null
,
"isprotected"
:
0
,
"linecoding"
:
""
,
"linkcosts"
:
null
,
"lossmeasured"
:
null
,
"measuredlength"
:
null
,
"mergecircuitmergingrelatedcircuits"
:
null
,
"migrationdate"
:
"2020-10-07T17:44:44"
,
"mspprotections"
:
null
,
"mspworkers"
:
null
,
"name"
:
"V-LAN_200_MX1.LON.UK_XE-0/0/1_"
,
"nodea"
:
null
,
"nodeaid"
:
129756
,
"nodeb"
:
null
,
"nodebid"
:
129079
,
"oldcircuits"
:
null
,
"oldname"
:
""
,
"olocircuits"
:
null
,
"order"
:
null
,
"orderid"
:
null
,
"outofservicedate"
:
null
,
"plmidate"
:
null
,
"ploosdate"
:
null
,
"porta"
:
null
,
"portaid"
:
6430303
,
"portb"
:
null
,
"portbid"
:
6419305
,
"portchannelrelations"
:
null
,
"portreservations"
:
null
,
"ports"
:
null
,
"product"
:
null
,
"productid"
:
3677
,
"projectnumber"
:
""
,
"projectstatus"
:
null
,
"protectiontype"
:
""
,
"protectiontypec"
:
""
,
"prottypea"
:
""
,
"prottypez"
:
""
,
"pwcircuits"
:
null
,
"pwmaincircuits"
:
null
,
"reconcilecircuits"
:
null
,
"relatedorders"
:
null
,
"ringsections"
:
null
,
"rowversion"
:
"2021-01-12T09:03:56"
,
"rtdcontract"
:
""
,
"rtdmaincalc"
:
""
,
"rtdmainmeasured"
:
""
,
"rtdsparecalc"
:
""
,
"rtdsparemeasured"
:
""
,
"sellingunit"
:
""
,
"sequencenumber"
:
""
,
"servicecircuits"
:
null
,
"serviceparts"
:
"JUNIPER"
,
"sitea"
:
null
,
"siteaid"
:
445244
,
"siteb"
:
null
,
"sitebid"
:
445244
,
"sla"
:
null
,
"slacks"
:
null
,
"slaid"
:
null
,
"speed"
:
null
,
"speedid"
:
3045
,
"spofcircuits"
:
null
,
"spofresultcircuits"
:
null
,
"spofresultcomparecircuits"
:
null
,
"spofresultprotectioncircuits"
:
null
,
"spofresultprotectioncircuits2"
:
null
,
"spofresultsubprotectioncircuits"
:
null
,
"spofresultsubprotectioncircuits2"
:
null
,
"spofresultsubworkercircuits"
:
null
,
"spofresultsubworkercircuits2"
:
null
,
"spofresultworkercircuits"
:
null
,
"spofresultworkercircuits2"
:
null
,
"stdornonstd"
:
0
,
"structuretype"
:
""
,
"subcircuits"
:
null
,
"tested"
:
0
,
"vendor"
:
"JUNIPER"
,
"vlanid"
:
null
,
"vminternalportrelatelist"
:
null
,
"vmportrelatelist"
:
null
,
"wtoptunnelprotections"
:
null
,
"wtoptunnelworkers"
:
null
},
"carriercircuitid"
:
660461
,
"channelkind"
:
"ETHS"
,
"circuitrelationchannelalias"
:
{
"channelalias"
:
null
,
"channelaliasid"
:
null
,
"errors"
:
null
,
"haserrors"
:
false
,
"id"
:
2491116
,
"rowversion"
:
"2020-12-10T19:52:28"
},
"comments"
:
""
,
"directionid"
:
0
,
"errors"
:
null
,
"haserrors"
:
false
,
"id"
:
2491116
,
"order"
:
null
,
"orderid"
:
null
,
"projectnumber"
:
""
,
"projectstatus"
:
1
,
"rowversion"
:
"2020-12-10T19:52:28"
,
"sequencenumber"
:
1
,
"subcircuit"
:
null
,
"subcircuitid"
:
661591
,
"timeslotfrom"
:
0
,
"timeslotto"
:
0
}
],
"channelreservations"
:
null
,
"circuitaliases"
:
null
,
"circuitattachments"
:
null
,
"circuitcoordinates"
:
null
,
"circuitcounts"
:
null
,
"circuitdomains"
:
null
,
"circuitmanagementsystems"
:
null
,
"circuitmergingrelatedcircuits"
:
null
,
"circuitprotectionprotections"
:
null
,
"circuitprotectionworkers"
:
null
,
"circuitrequestor"
:
""
,
"circuittypeid"
:
0
,
"coscircuits"
:
null
,
"createdate"
:
"2020-02-19T20:48:42"
,
"createuser"
:
null
,
"createuserid"
:
8338
,
"csc"
:
null
,
"cscid"
:
null
,
"customer"
:
{
"accountemail"
:
""
,
"accountmanager"
:
""
,
"address"
:
""
,
"channelreservations"
:
null
,
"circuits"
:
null
,
"code"
:
""
,
"contractcustomerrelations"
:
null
,
"country"
:
null
,
"countryid"
:
null
,
"customerrelatedcontacts"
:
null
,
"customerrelatedcontracts"
:
null
,
"customertype"
:
null
,
"customertypeid"
:
7
,
"errors"
:
null
,
"esimprofiles"
:
null
,
"esims"
:
null
,
"faxnumber"
:
""
,
"fullname"
:
"ORIENTPLUS"
,
"haserrors"
:
false
,
"id"
:
57773
,
"innumbers"
:
null
,
"ipranges"
:
null
,
"managementsystems"
:
null
,
"name"
:
"ORIENTPLUS"
,
"nodes"
:
null
,
"number"
:
null
,
"numbermanagementlist"
:
null
,
"olocircuits"
:
null
,
"orders"
:
null
,
"parentcustomer"
:
null
,
"parentcustomerid"
:
null
,
"phonenumber"
:
""
,
"portreservations"
:
null
,
"pwcodeblue"
:
0
,
"pwemailsetups"
:
null
,
"pwextrainfo"
:
""
,
"pwinformatrisk"
:
1
,
"pwinformdown"
:
1
,
"pwinformedlist"
:
null
,
"pwinformimpact"
:
1
,
"pwinformnoimpact"
:
1
,
"pwinformprotectionswitch"
:
1
,
"pwlanguage"
:
""
,
"racks"
:
null
,
"rowversion"
:
"2020-02-14T20:56:59"
,
"servicecenter"
:
0
,
"servicecentername"
:
""
,
"sites"
:
null
,
"sla"
:
null
,
"slaid"
:
null
,
"speeds"
:
null
,
"subcustomers"
:
null
,
"telephonenumberranges"
:
null
,
"telephonenumbers"
:
null
,
"website"
:
""
},
"customerid"
:
57773
,
"ddfodfports"
:
null
,
"ddfodfpositionfromto"
:
null
,
"ddfodfpositions"
:
null
,
"deliverdate"
:
"2020-02-20T20:33:43"
,
"designref"
:
""
,
"dsls"
:
null
,
"errors"
:
null
,
"extrainfo"
:
""
,
"extrainfoimportant"
:
0
,
"fitstatus"
:
""
,
"floorplanlines"
:
null
,
"frameatms"
:
null
,
"framessizerequired"
:
null
,
"framing"
:
""
,
"geocircuitspiped"
:
null
,
"geodataisineditmode"
:
null
,
"geoworkersandprotections"
:
null
,
"haserrors"
:
false
,
"id"
:
661591
,
"internalporta"
:
null
,
"internalportaid"
:
null
,
"internalportb"
:
null
,
"internalportbid"
:
null
,
"internalports"
:
null
,
"inventorystatusid"
:
3
,
"ipranges"
:
null
,
"isprotected"
:
0
,
"linecoding"
:
""
,
"linkcosts"
:
null
,
"lossmeasured"
:
null
,
"measuredlength"
:
null
,
"mergecircuitmergingrelatedcircuits"
:
null
,
"migrationdate"
:
"2020-12-10T19:52:28"
,
"mspprotections"
:
null
,
"mspworkers"
:
null
,
"name"
:
"UK_ORIENT"
,
"nodea"
:
null
,
"nodeaid"
:
129756
,
"nodeb"
:
null
,
"nodebid"
:
129079
,
"oldcircuits"
:
null
,
"oldname"
:
""
,
"olocircuits"
:
null
,
"order"
:
null
,
"orderid"
:
null
,
"outofservicedate"
:
null
,
"plmidate"
:
null
,
"ploosdate"
:
null
,
"porta"
:
null
,
"portaid"
:
6430303
,
"portb"
:
null
,
"portbid"
:
6419305
,
"portchannelrelations"
:
null
,
"portreservations"
:
null
,
"ports"
:
null
,
"product"
:
{
"aliasproduct"
:
""
,
"circuits"
:
[],
"contid"
:
""
,
"createsubcircuits"
:
""
,
"description"
:
"IP PEERING - R&E"
,
"diameter"
:
null
,
"domain"
:
null
,
"domainid"
:
null
,
"errors"
:
null
,
"fiberlosspermeter"
:
null
,
"groupid"
:
""
,
"haserrors"
:
false
,
"id"
:
3819
,
"materialtypes"
:
null
,
"name"
:
"IP PEERING - R&E"
,
"productlines"
:
""
,
"report"
:
0
,
"rowversion"
:
"2020-07-07T10:58:36"
,
"speed"
:
null
,
"speedid"
:
null
,
"speeds"
:
null
,
"thickness"
:
null
},
"productid"
:
3819
,
"projectnumber"
:
""
,
"projectstatus"
:
null
,
"protectiontype"
:
""
,
"protectiontypec"
:
""
,
"prottypea"
:
""
,
"prottypez"
:
""
,
"pwcircuits"
:
null
,
"pwmaincircuits"
:
null
,
"reconcilecircuits"
:
null
,
"relatedorders"
:
null
,
"ringsections"
:
null
,
"rowversion"
:
"2021-01-12T09:31:41"
,
"rtdcontract"
:
""
,
"rtdmaincalc"
:
""
,
"rtdmainmeasured"
:
""
,
"rtdsparecalc"
:
""
,
"rtdsparemeasured"
:
""
,
"sellingunit"
:
""
,
"sequencenumber"
:
""
,
"servicecircuits"
:
null
,
"serviceparts"
:
"JUNIPER"
,
"sitea"
:
null
,
"siteaid"
:
445244
,
"siteb"
:
null
,
"sitebid"
:
445244
,
"sla"
:
null
,
"slacks"
:
null
,
"slaid"
:
null
,
"speed"
:
{
"aendmandatory"
:
1
,
"carrierchannelaliases"
:
null
,
"carrierlayerrules"
:
null
,
"channelview"
:
"NORMAL"
,
"circuitnametemplate"
:
""
,
"circuits"
:
[],
"circuittypeoption"
:
0
,
"defaultcustomer"
:
null
,
"defaultcustomerid"
:
57744
,
"defaultproduct"
:
null
,
"defaultproductid"
:
3677
,
"defaultserviceparts"
:
""
,
"defaultvendor"
:
""
,
"drawsubcircuit"
:
0
,
"e2echeck"
:
0
,
"errors"
:
null
,
"extrainfo"
:
""
,
"graphicalx"
:
null
,
"graphicaly"
:
null
,
"haserrors"
:
false
,
"id"
:
3044
,
"isgeo"
:
0
,
"kbits"
:
null
,
"layouttype"
:
"NORMAL"
,
"maxgraphicallayerdepth"
:
2
,
"multipoint"
:
0
,
"name"
:
"ETHS"
,
"oloproducts"
:
null
,
"olospeedallowed"
:
""
,
"optical"
:
0
,
"products"
:
null
,
"rowversion"
:
"2020-02-07T14:50:26"
,
"showcircuitaddnewmenu"
:
1
,
"showsubcircuitmenu"
:
1
,
"showvlanid"
:
0
,
"speedcolor"
:
null
,
"speedtype"
:
"S"
,
"subchannelaliases"
:
null
,
"subchannelfrom"
:
0
,
"subchannelto"
:
4095
,
"subchanneltype"
:
""
,
"subcircuitlayerrules"
:
null
,
"test"
:
0
,
"usesubcapacity"
:
0
,
"wizardusable"
:
0
,
"zendmandatory"
:
1
},
"speedid"
:
3044
,
"spofcircuits"
:
null
,
"spofresultcircuits"
:
null
,
"spofresultcomparecircuits"
:
null
,
"spofresultprotectioncircuits"
:
null
,
"spofresultprotectioncircuits2"
:
null
,
"spofresultsubprotectioncircuits"
:
null
,
"spofresultsubprotectioncircuits2"
:
null
,
"spofresultsubworkercircuits"
:
null
,
"spofresultsubworkercircuits2"
:
null
,
"spofresultworkercircuits"
:
null
,
"spofresultworkercircuits2"
:
null
,
"stdornonstd"
:
0
,
"structuretype"
:
""
,
"subcircuits"
:
[],
"tested"
:
0
,
"vendor"
:
"JUNIPER"
,
"vlanid"
:
null
,
"vminternalportrelatelist"
:
null
,
"vmportrelatelist"
:
null
,
"wtoptunnelprotections"
:
null
,
"wtoptunnelworkers"
:
null
},
{
"acquisitiondate"
:
null
,
"antennafeeders"
:
null
,
"bicableports"
:
null
,
"blocked"
:
0
,
"cableports"
:
null
,
"calculatedlength"
:
null
,
"carriercircuits"
:
[
{
"carriercircuit"
:
{
"acquisitiondate"
:
null
,
"antennafeeders"
:
null
,
"bicableports"
:
null
,
"blocked"
:
0
,
"cableports"
:
null
,
"calculatedlength"
:
null
,
"carriercircuits"
:
null
,
"channelreservations"
:
null
,
"circuitaliases"
:
null
,
"circuitattachments"
:
null
,
"circuitcoordinates"
:
null
,
"circuitcounts"
:
null
,
"circuitdomains"
:
null
,
"circuitmanagementsystems"
:
null
,
"circuitmergingrelatedcircuits"
:
null
,
"circuitprotectionprotections"
:
null
,
"circuitprotectionworkers"
:
null
,
"circuitrequestor"
:
""
,
"circuittypeid"
:
0
,
"coscircuits"
:
null
,
"createdate"
:
"2020-03-10T15:38:46"
,
"createuser"
:
null
,
"createuserid"
:
6727
,
"csc"
:
null
,
"cscid"
:
null
,
"customer"
:
null
,
"customerid"
:
57773
,
"ddfodfports"
:
null
,
"ddfodfpositionfromto"
:
null
,
"ddfodfpositions"
:
null
,
"deliverdate"
:
"2020-08-31T11:16:48"
,
"designref"
:
""
,
"dsls"
:
null
,
"errors"
:
null
,
"extrainfo"
:
""
,
"extrainfoimportant"
:
0
,
"fitstatus"
:
""
,
"floorplanlines"
:
null
,
"frameatms"
:
null
,
"framessizerequired"
:
null
,
"framing"
:
""
,
"geocircuitspiped"
:
null
,
"geodataisineditmode"
:
null
,
"geoworkersandprotections"
:
null
,
"haserrors"
:
false
,
"id"
:
668866
,
"internalporta"
:
null
,
"internalportaid"
:
null
,
"internalportb"
:
null
,
"internalportbid"
:
null
,
"internalports"
:
null
,
"inventorystatusid"
:
3
,
"ipranges"
:
null
,
"isprotected"
:
0
,
"linecoding"
:
""
,
"linkcosts"
:
null
,
"lossmeasured"
:
null
,
"measuredlength"
:
null
,
"mergecircuitmergingrelatedcircuits"
:
null
,
"migrationdate"
:
"2020-12-10T19:50:36"
,
"mspprotections"
:
null
,
"mspworkers"
:
null
,
"name"
:
"LON-BEIJING-LEASEDSPAN"
,
"nodea"
:
null
,
"nodeaid"
:
129079
,
"nodeb"
:
null
,
"nodebid"
:
129756
,
"oldcircuits"
:
null
,
"oldname"
:
""
,
"olocircuits"
:
null
,
"order"
:
null
,
"orderid"
:
70168
,
"outofservicedate"
:
null
,
"plmidate"
:
null
,
"ploosdate"
:
null
,
"porta"
:
null
,
"portaid"
:
6419305
,
"portb"
:
null
,
"portbid"
:
6430303
,
"portchannelrelations"
:
null
,
"portreservations"
:
null
,
"ports"
:
null
,
"product"
:
null
,
"productid"
:
3677
,
"projectnumber"
:
""
,
"projectstatus"
:
null
,
"protectiontype"
:
""
,
"protectiontypec"
:
""
,
"prottypea"
:
""
,
"prottypez"
:
""
,
"pwcircuits"
:
null
,
"pwmaincircuits"
:
null
,
"reconcilecircuits"
:
null
,
"relatedorders"
:
null
,
"ringsections"
:
null
,
"rowversion"
:
"2021-01-12T08:58:53"
,
"rtdcontract"
:
""
,
"rtdmaincalc"
:
""
,
"rtdmainmeasured"
:
""
,
"rtdsparecalc"
:
""
,
"rtdsparemeasured"
:
""
,
"sellingunit"
:
""
,
"sequencenumber"
:
""
,
"servicecircuits"
:
null
,
"serviceparts"
:
"UNKNOWN"
,
"sitea"
:
null
,
"siteaid"
:
445244
,
"siteb"
:
null
,
"sitebid"
:
445060
,
"sla"
:
null
,
"slacks"
:
null
,
"slaid"
:
null
,
"speed"
:
null
,
"speedid"
:
3064
,
"spofcircuits"
:
null
,
"spofresultcircuits"
:
null
,
"spofresultcomparecircuits"
:
null
,
"spofresultprotectioncircuits"
:
null
,
"spofresultprotectioncircuits2"
:
null
,
"spofresultsubprotectioncircuits"
:
null
,
"spofresultsubprotectioncircuits2"
:
null
,
"spofresultsubworkercircuits"
:
null
,
"spofresultsubworkercircuits2"
:
null
,
"spofresultworkercircuits"
:
null
,
"spofresultworkercircuits2"
:
null
,
"stdornonstd"
:
0
,
"structuretype"
:
""
,
"subcircuits"
:
null
,
"tested"
:
0
,
"vendor"
:
"CHINA UNICOM"
,
"vlanid"
:
null
,
"vminternalportrelatelist"
:
null
,
"vmportrelatelist"
:
null
,
"wtoptunnelprotections"
:
null
,
"wtoptunnelworkers"
:
null
},
"carriercircuitid"
:
668866
,
"channelkind"
:
"VLAN"
,
"circuitrelationchannelalias"
:
{
"channelalias"
:
null
,
"channelaliasid"
:
null
,
"errors"
:
null
,
"haserrors"
:
false
,
"id"
:
2493336
,
"rowversion"
:
"2020-10-12T09:30:36"
},
"comments"
:
""
,
"directionid"
:
0
,
"errors"
:
null
,
"haserrors"
:
false
,
"id"
:
2493336
,
"order"
:
null
,
"orderid"
:
null
,
"projectnumber"
:
""
,
"projectstatus"
:
1
,
"rowversion"
:
"2020-10-12T09:30:36"
,
"sequencenumber"
:
1
,
"subcircuit"
:
null
,
"subcircuitid"
:
660461
,
"timeslotfrom"
:
200
,
"timeslotto"
:
200
}
],
"channelreservations"
:
null
,
"circuitaliases"
:
null
,
"circuitattachments"
:
null
,
"circuitcoordinates"
:
null
,
"circuitcounts"
:
null
,
"circuitdomains"
:
null
,
"circuitmanagementsystems"
:
null
,
"circuitmergingrelatedcircuits"
:
null
,
"circuitprotectionprotections"
:
null
,
"circuitprotectionworkers"
:
null
,
"circuitrequestor"
:
""
,
"circuittypeid"
:
0
,
"coscircuits"
:
null
,
"createdate"
:
"2020-02-19T20:20:07"
,
"createuser"
:
null
,
"createuserid"
:
8338
,
"csc"
:
null
,
"cscid"
:
null
,
"customer"
:
{
"accountemail"
:
""
,
"accountmanager"
:
""
,
"address"
:
""
,
"channelreservations"
:
null
,
"circuits"
:
null
,
"code"
:
""
,
"contractcustomerrelations"
:
null
,
"country"
:
null
,
"countryid"
:
null
,
"customerrelatedcontacts"
:
null
,
"customerrelatedcontracts"
:
null
,
"customertype"
:
null
,
"customertypeid"
:
7
,
"errors"
:
null
,
"esimprofiles"
:
null
,
"esims"
:
null
,
"faxnumber"
:
""
,
"fullname"
:
"ORIENTPLUS"
,
"haserrors"
:
false
,
"id"
:
57773
,
"innumbers"
:
null
,
"ipranges"
:
null
,
"managementsystems"
:
null
,
"name"
:
"ORIENTPLUS"
,
"nodes"
:
null
,
"number"
:
null
,
"numbermanagementlist"
:
null
,
"olocircuits"
:
null
,
"orders"
:
null
,
"parentcustomer"
:
null
,
"parentcustomerid"
:
null
,
"phonenumber"
:
""
,
"portreservations"
:
null
,
"pwcodeblue"
:
0
,
"pwemailsetups"
:
null
,
"pwextrainfo"
:
""
,
"pwinformatrisk"
:
1
,
"pwinformdown"
:
1
,
"pwinformedlist"
:
null
,
"pwinformimpact"
:
1
,
"pwinformnoimpact"
:
1
,
"pwinformprotectionswitch"
:
1
,
"pwlanguage"
:
""
,
"racks"
:
null
,
"rowversion"
:
"2020-02-14T20:56:59"
,
"servicecenter"
:
0
,
"servicecentername"
:
""
,
"sites"
:
null
,
"sla"
:
null
,
"slaid"
:
null
,
"speeds"
:
null
,
"subcustomers"
:
null
,
"telephonenumberranges"
:
null
,
"telephonenumbers"
:
null
,
"website"
:
""
},
"customerid"
:
57773
,
"ddfodfports"
:
null
,
"ddfodfpositionfromto"
:
null
,
"ddfodfpositions"
:
null
,
"deliverdate"
:
"2020-02-19T20:20:07"
,
"designref"
:
""
,
"dsls"
:
null
,
"errors"
:
null
,
"extrainfo"
:
""
,
"extrainfoimportant"
:
0
,
"fitstatus"
:
""
,
"floorplanlines"
:
null
,
"frameatms"
:
null
,
"framessizerequired"
:
null
,
"framing"
:
""
,
"geocircuitspiped"
:
null
,
"geodataisineditmode"
:
null
,
"geoworkersandprotections"
:
null
,
"haserrors"
:
false
,
"id"
:
660461
,
"internalporta"
:
null
,
"internalportaid"
:
null
,
"internalportb"
:
null
,
"internalportbid"
:
null
,
"internalports"
:
null
,
"inventorystatusid"
:
3
,
"ipranges"
:
null
,
"isprotected"
:
0
,
"linecoding"
:
""
,
"linkcosts"
:
null
,
"lossmeasured"
:
null
,
"measuredlength"
:
null
,
"mergecircuitmergingrelatedcircuits"
:
null
,
"migrationdate"
:
"2020-10-07T17:44:44"
,
"mspprotections"
:
null
,
"mspworkers"
:
null
,
"name"
:
"V-LAN_200_MX1.LON.UK_XE-0/0/1_"
,
"nodea"
:
null
,
"nodeaid"
:
129756
,
"nodeb"
:
null
,
"nodebid"
:
129079
,
"oldcircuits"
:
null
,
"oldname"
:
""
,
"olocircuits"
:
null
,
"order"
:
null
,
"orderid"
:
null
,
"outofservicedate"
:
null
,
"plmidate"
:
null
,
"ploosdate"
:
null
,
"porta"
:
null
,
"portaid"
:
6430303
,
"portb"
:
null
,
"portbid"
:
6419305
,
"portchannelrelations"
:
null
,
"portreservations"
:
null
,
"ports"
:
null
,
"product"
:
{
"aliasproduct"
:
""
,
"circuits"
:
[],
"contid"
:
""
,
"createsubcircuits"
:
""
,
"description"
:
"ETHERNET"
,
"diameter"
:
null
,
"domain"
:
null
,
"domainid"
:
null
,
"errors"
:
null
,
"fiberlosspermeter"
:
null
,
"groupid"
:
""
,
"haserrors"
:
false
,
"id"
:
3677
,
"materialtypes"
:
null
,
"name"
:
"ETHERNET"
,
"productlines"
:
""
,
"report"
:
0
,
"rowversion"
:
"2020-04-06T12:28:38"
,
"speed"
:
null
,
"speedid"
:
null
,
"speeds"
:
null
,
"thickness"
:
null
},
"productid"
:
3677
,
"projectnumber"
:
""
,
"projectstatus"
:
null
,
"protectiontype"
:
""
,
"protectiontypec"
:
""
,
"prottypea"
:
""
,
"prottypez"
:
""
,
"pwcircuits"
:
null
,
"pwmaincircuits"
:
null
,
"reconcilecircuits"
:
null
,
"relatedorders"
:
null
,
"ringsections"
:
null
,
"rowversion"
:
"2021-01-12T09:03:56"
,
"rtdcontract"
:
""
,
"rtdmaincalc"
:
""
,
"rtdmainmeasured"
:
""
,
"rtdsparecalc"
:
""
,
"rtdsparemeasured"
:
""
,
"sellingunit"
:
""
,
"sequencenumber"
:
""
,
"servicecircuits"
:
null
,
"serviceparts"
:
"JUNIPER"
,
"sitea"
:
null
,
"siteaid"
:
445244
,
"siteb"
:
null
,
"sitebid"
:
445244
,
"sla"
:
null
,
"slacks"
:
null
,
"slaid"
:
null
,
"speed"
:
{
"aendmandatory"
:
0
,
"carrierchannelaliases"
:
null
,
"carrierlayerrules"
:
null
,
"channelview"
:
"NORMAL"
,
"circuitnametemplate"
:
""
,
"circuits"
:
[],
"circuittypeoption"
:
0
,
"defaultcustomer"
:
null
,
"defaultcustomerid"
:
57744
,
"defaultproduct"
:
null
,
"defaultproductid"
:
3677
,
"defaultserviceparts"
:
""
,
"defaultvendor"
:
""
,
"drawsubcircuit"
:
0
,
"e2echeck"
:
0
,
"errors"
:
null
,
"extrainfo"
:
""
,
"graphicalx"
:
null
,
"graphicaly"
:
null
,
"haserrors"
:
false
,
"id"
:
3045
,
"isgeo"
:
0
,
"kbits"
:
null
,
"layouttype"
:
"NORMAL"
,
"maxgraphicallayerdepth"
:
2
,
"multipoint"
:
0
,
"name"
:
"V-LAN"
,
"oloproducts"
:
null
,
"olospeedallowed"
:
""
,
"optical"
:
0
,
"products"
:
null
,
"rowversion"
:
"2020-02-07T14:51:29"
,
"showcircuitaddnewmenu"
:
1
,
"showsubcircuitmenu"
:
1
,
"showvlanid"
:
0
,
"speedcolor"
:
null
,
"speedtype"
:
"VLAN"
,
"subchannelaliases"
:
null
,
"subchannelfrom"
:
0
,
"subchannelto"
:
4095
,
"subchanneltype"
:
""
,
"subcircuitlayerrules"
:
null
,
"test"
:
0
,
"usesubcapacity"
:
0
,
"wizardusable"
:
0
,
"zendmandatory"
:
0
},
"speedid"
:
3045
,
"spofcircuits"
:
null
,
"spofresultcircuits"
:
null
,
"spofresultcomparecircuits"
:
null
,
"spofresultprotectioncircuits"
:
null
,
"spofresultprotectioncircuits2"
:
null
,
"spofresultsubprotectioncircuits"
:
null
,
"spofresultsubprotectioncircuits2"
:
null
,
"spofresultsubworkercircuits"
:
null
,
"spofresultsubworkercircuits2"
:
null
,
"spofresultworkercircuits"
:
null
,
"spofresultworkercircuits2"
:
null
,
"stdornonstd"
:
0
,
"structuretype"
:
""
,
"subcircuits"
:
[
{
"carriercircuit"
:
null
,
"carriercircuitid"
:
660461
,
"channelkind"
:
"ETHS"
,
"circuitrelationchannelalias"
:
null
,
"comments"
:
""
,
"directionid"
:
0
,
"errors"
:
null
,
"haserrors"
:
false
,
"id"
:
2491116
,
"order"
:
null
,
"orderid"
:
null
,
"projectnumber"
:
""
,
"projectstatus"
:
1
,
"rowversion"
:
"2020-12-10T19:52:28"
,
"sequencenumber"
:
1
,
"subcircuit"
:
{
"acquisitiondate"
:
null
,
"antennafeeders"
:
null
,
"bicableports"
:
null
,
"blocked"
:
0
,
"cableports"
:
null
,
"calculatedlength"
:
null
,
"carriercircuits"
:
null
,
"channelreservations"
:
null
,
"circuitaliases"
:
null
,
"circuitattachments"
:
null
,
"circuitcoordinates"
:
null
,
"circuitcounts"
:
null
,
"circuitdomains"
:
null
,
"circuitmanagementsystems"
:
null
,
"circuitmergingrelatedcircuits"
:
null
,
"circuitprotectionprotections"
:
null
,
"circuitprotectionworkers"
:
null
,
"circuitrequestor"
:
""
,
"circuittypeid"
:
0
,
"coscircuits"
:
null
,
"createdate"
:
"2020-02-19T20:48:42"
,
"createuser"
:
null
,
"createuserid"
:
8338
,
"csc"
:
null
,
"cscid"
:
null
,
"customer"
:
null
,
"customerid"
:
57773
,
"ddfodfports"
:
null
,
"ddfodfpositionfromto"
:
null
,
"ddfodfpositions"
:
null
,
"deliverdate"
:
"2020-02-20T20:33:43"
,
"designref"
:
""
,
"dsls"
:
null
,
"errors"
:
null
,
"extrainfo"
:
""
,
"extrainfoimportant"
:
0
,
"fitstatus"
:
""
,
"floorplanlines"
:
null
,
"frameatms"
:
null
,
"framessizerequired"
:
null
,
"framing"
:
""
,
"geocircuitspiped"
:
null
,
"geodataisineditmode"
:
null
,
"geoworkersandprotections"
:
null
,
"haserrors"
:
false
,
"id"
:
661591
,
"internalporta"
:
null
,
"internalportaid"
:
null
,
"internalportb"
:
null
,
"internalportbid"
:
null
,
"internalports"
:
null
,
"inventorystatusid"
:
3
,
"ipranges"
:
null
,
"isprotected"
:
0
,
"linecoding"
:
""
,
"linkcosts"
:
null
,
"lossmeasured"
:
null
,
"measuredlength"
:
null
,
"mergecircuitmergingrelatedcircuits"
:
null
,
"migrationdate"
:
"2020-12-10T19:52:28"
,
"mspprotections"
:
null
,
"mspworkers"
:
null
,
"name"
:
"UK_ORIENT"
,
"nodea"
:
null
,
"nodeaid"
:
129756
,
"nodeb"
:
null
,
"nodebid"
:
129079
,
"oldcircuits"
:
null
,
"oldname"
:
""
,
"olocircuits"
:
null
,
"order"
:
null
,
"orderid"
:
null
,
"outofservicedate"
:
null
,
"plmidate"
:
null
,
"ploosdate"
:
null
,
"porta"
:
null
,
"portaid"
:
6430303
,
"portb"
:
null
,
"portbid"
:
6419305
,
"portchannelrelations"
:
null
,
"portreservations"
:
null
,
"ports"
:
null
,
"product"
:
null
,
"productid"
:
3819
,
"projectnumber"
:
""
,
"projectstatus"
:
null
,
"protectiontype"
:
""
,
"protectiontypec"
:
""
,
"prottypea"
:
""
,
"prottypez"
:
""
,
"pwcircuits"
:
null
,
"pwmaincircuits"
:
null
,
"reconcilecircuits"
:
null
,
"relatedorders"
:
null
,
"ringsections"
:
null
,
"rowversion"
:
"2021-01-12T09:31:41"
,
"rtdcontract"
:
""
,
"rtdmaincalc"
:
""
,
"rtdmainmeasured"
:
""
,
"rtdsparecalc"
:
""
,
"rtdsparemeasured"
:
""
,
"sellingunit"
:
""
,
"sequencenumber"
:
""
,
"servicecircuits"
:
null
,
"serviceparts"
:
"JUNIPER"
,
"sitea"
:
null
,
"siteaid"
:
445244
,
"siteb"
:
null
,
"sitebid"
:
445244
,
"sla"
:
null
,
"slacks"
:
null
,
"slaid"
:
null
,
"speed"
:
null
,
"speedid"
:
3044
,
"spofcircuits"
:
null
,
"spofresultcircuits"
:
null
,
"spofresultcomparecircuits"
:
null
,
"spofresultprotectioncircuits"
:
null
,
"spofresultprotectioncircuits2"
:
null
,
"spofresultsubprotectioncircuits"
:
null
,
"spofresultsubprotectioncircuits2"
:
null
,
"spofresultsubworkercircuits"
:
null
,
"spofresultsubworkercircuits2"
:
null
,
"spofresultworkercircuits"
:
null
,
"spofresultworkercircuits2"
:
null
,
"stdornonstd"
:
0
,
"structuretype"
:
""
,
"subcircuits"
:
null
,
"tested"
:
0
,
"vendor"
:
"JUNIPER"
,
"vlanid"
:
null
,
"vminternalportrelatelist"
:
null
,
"vmportrelatelist"
:
null
,
"wtoptunnelprotections"
:
null
,
"wtoptunnelworkers"
:
null
},
"subcircuitid"
:
661591
,
"timeslotfrom"
:
0
,
"timeslotto"
:
0
}
],
"tested"
:
0
,
"vendor"
:
"JUNIPER"
,
"vlanid"
:
null
,
"vminternalportrelatelist"
:
null
,
"vmportrelatelist"
:
null
,
"wtoptunnelprotections"
:
null
,
"wtoptunnelworkers"
:
null
}
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test/test_ims_data.py
+
41
−
1
View file @
9728d81e
...
...
@@ -5,7 +5,47 @@ from inventory_provider.db.ims import InventoryStatus
from
inventory_provider.db.ims_data
import
lookup_lg_routers
,
\
otrs_get_customer_company_rows
,
\
otrs_get_customer_users_rows
,
get_node_locations
,
IMS_OPSDB_STATUS_MAP
,
\
get_fibre_info
,
get_port_id_services
,
get_port_details
get_fibre_info
,
get_port_id_services
,
get_port_details
,
\
get_circuit_hierarchy
def
test_get_circuit_hierarchy
(
mocker
):
ds
=
inventory_provider
.
db
.
ims
.
IMS
(
'
dummy_base
'
,
'
dummy_username
'
,
'
dummy_password
'
)
with
open
(
'
test/data/ims_circuit_hierarchy_data.json
'
)
as
data
:
se_data
=
json
.
load
(
data
)
mocked_get
=
mocker
.
patch
.
object
(
inventory_provider
.
db
.
ims
.
IMS
,
'
get_all_entities
'
)
mocked_get
.
return_value
=
se_data
res
=
list
(
get_circuit_hierarchy
(
ds
))
assert
ds
.
get_all_entities
.
call_count
==
1
predicted
=
[
{
'
id
'
:
661591
,
'
name
'
:
'
UK_ORIENT
'
,
'
status
'
:
'
operational
'
,
'
product
'
:
'
IP PEERING - R&E
'
,
'
speed
'
:
'
ETHS
'
,
'
project
'
:
'
ORIENTPLUS
'
,
'
sub-circuits
'
:
[],
'
carrier-circuits
'
:
[
660461
]
},
{
'
id
'
:
660461
,
'
name
'
:
'
V-LAN_200_MX1.LON.UK_XE-0/0/1_
'
,
'
status
'
:
'
operational
'
,
'
product
'
:
'
ETHERNET
'
,
'
speed
'
:
'
V-LAN
'
,
'
project
'
:
'
ORIENTPLUS
'
,
'
sub-circuits
'
:
[
661591
],
'
carrier-circuits
'
:
[
668866
]
}
]
assert
res
==
predicted
def
test_get_port_details
(
mocker
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment