Skip to content
Snippets Groups Projects

Adding testing for mic

Merged Saket Agrahari requested to merge feature/DBOARD3-676 into develop
3 files
+ 53
39
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -60,13 +60,12 @@ NODE_LOCATION_SCHEMA = {
'properties': {
'equipment-name': {'type': 'string'},
'status': {'type': 'string'},
'pop': {'$ref': '#/definitions/pop-location'}
'pop': {'$ref': '#/definitions/pop-location'}
},
'required': ['equipment-name', 'status', 'pop'],
'additionalProperties': False
}
SITE_LOCATION_SCHEMA = {
'$schema': 'https://json-schema.org/draft-07/schema#',
**_POP_LOCATION_SCHEMA_STRUCT
@@ -117,12 +116,13 @@ def get_monitored_circuit_ids(ds: IMS):
@log_entry_and_exit
def get_ids_and_sids(ds: IMS):
for sid_circuit in ds.get_filtered_entities(
'ExtraFieldValue',
'extrafieldid == 3209 | value <> ""',
step_count=10000
'ExtraFieldValue',
'extrafieldid == 3209 | value <> ""',
step_count=10000
):
yield sid_circuit['objectid'], sid_circuit['value']
@log_entry_and_exit
def get_ids_and_third_party_ids(ds: IMS):
for circuit in ds.get_filtered_entities(
@@ -132,6 +132,7 @@ def get_ids_and_third_party_ids(ds: IMS):
):
yield circuit['objectid'], circuit['value']
@log_entry_and_exit
def get_service_types(ds: IMS):
for d in ds.get_filtered_entities(
@@ -142,13 +143,12 @@ def get_service_types(ds: IMS):
@log_entry_and_exit
def get_customer_tts_contacts(ds: IMS):
customer_contacts = defaultdict(set)
for x in ds.get_filtered_entities(
'customerrelatedcontact',
"contact.troubleticketMail != ''",
CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
'customerrelatedcontact',
"contact.troubleticketMail != ''",
CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
):
customer_contacts[x['customerid']].add(
x['contact']['troubleticketmail'])
@@ -158,13 +158,12 @@ def get_customer_tts_contacts(ds: IMS):
@log_entry_and_exit
def get_customer_planned_work_contacts(ds: IMS):
customer_contacts = defaultdict(set)
for x in ds.get_filtered_entities(
'customerrelatedcontact',
"contact.PlannedworkMail != ''",
CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
'customerrelatedcontact',
"contact.PlannedworkMail != ''",
CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
):
customer_contacts[x['customerid']].add(
x['contact']['plannedworkmail'])
@@ -174,11 +173,10 @@ def get_customer_planned_work_contacts(ds: IMS):
@log_entry_and_exit
def get_circuit_related_customers(ds: IMS):
return_value = defaultdict(list)
for ccr in ds.get_filtered_entities(
'CircuitCustomerRelation',
'circuit.inventoryStatusId== 3',
'CircuitCustomerRelation',
'circuit.inventoryStatusId== 3',
ims.CIRCUIT_CUSTOMER_RELATION['Customer']):
return_value[ccr['circuitid']].append(
{
@@ -481,13 +479,13 @@ def get_site_locations(ds: IMS):
has_geo_data = bool(site.get('longitude') and site.get('latitude'))
if abbreviation and has_geo_data:
yield site['name'], {
'name': site['name'],
'city': city['name'],
'country': city['country']['name'],
'abbreviation': abbreviation,
'longitude': site['longitude'],
'latitude': site['latitude'],
}
'name': site['name'],
'city': city['name'],
'country': city['country']['name'],
'abbreviation': abbreviation,
'longitude': site['longitude'],
'latitude': site['latitude'],
}
@log_entry_and_exit
@@ -616,14 +614,14 @@ def lookup_lg_routers(ds: IMS):
'INTERNAL'
if site['name'] in INTERNAL_POP_NAMES
else 'CORE',
'pop': {
'name': site['name'],
'city': city['name'],
'country': city['country']['name'],
'country code': city['country']['abbreviation'],
'abbreviation': abbreviation,
'longitude': site['longitude'],
'latitude': site['latitude'],
'pop': {
'name': site['name'],
'city': city['name'],
'country': city['country']['name'],
'country code': city['country']['abbreviation'],
'abbreviation': abbreviation,
'longitude': site['longitude'],
'latitude': site['latitude'],
}
}
yield eq
@@ -631,8 +629,7 @@ def lookup_lg_routers(ds: IMS):
@log_entry_and_exit
def lookup_geant_nodes(ds: IMS):
return (n["name"]for n in ds.get_filtered_entities(
return (n["name"] for n in ds.get_filtered_entities(
'Node',
'customer.Name == "GEANT"',
ims.EQUIP_DEF_PROPERTIES['Nodes']))
Loading