Skip to content
Snippets Groups Projects
Commit 728465bc authored by Erik Reid's avatar Erik Reid
Browse files

added a unit test for opsdb.get_service_users

parent 7f39c902
No related branches found
No related tags found
No related merge requests found
......@@ -164,3 +164,30 @@ def test_equipment_location(connection, equipment):
def test_coriant_path(connection, equipment, card, port):
circuit = opsdb.lookup_coriant_path(connection, equipment, card, port)
jsonschema.validate(circuit, CORIANT_PATH_METADATA)
def test_get_service_users(connection):
schema = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'definitions': {
'service-user': {
'type': 'object',
'properties': {
'service_id': {'type': 'integer'},
'user': {'type': 'string'}
},
'required': ['service_id', 'user'],
'additionalProperties': False
}
},
'type': 'array',
'items': {'$ref': '#/definitions/service-user'}
}
service_id_list = [47673, 47675]
users = opsdb.get_service_users(connection, service_id_list)
users = list(users)
jsonschema.validate(users, schema)
assert users
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment