Skip to content
Snippets Groups Projects
Commit e95824af authored by Robert Latta's avatar Robert Latta
Browse files

updated coriant test - still need to add mocking for ' _get_top_level_services'

parent b9ade536
No related branches found
No related tags found
No related merge requests found
......@@ -282,13 +282,13 @@ def test_peer_not_found(client):
assert rv.status_code == 404
@pytest.mark.parametrize('equipment,entity_name,card_id,port_number', [
('grv3.ams.nl.geant.net', '1-1.3.1-100GbE-ODU4-TTP1', '1-1', '3'),
('bogus-hostname.with&special.char',
@pytest.mark.parametrize('id_,equipment,entity_name,card_id,port_number', [
('123', 'grv3.ams.nl.geant.net', '1-1.3.1-100GbE-ODU4-TTP1', '1-1', '3'),
('123', 'bogus-hostname.with&special.char',
'234-2345234.7878i234crazynamewithslash/1-2.3', '234-2345234', '7878')
])
def test_coriant_info(
client, mocker, equipment, entity_name, card_id, port_number):
client, mocker, id_, equipment, entity_name, card_id, port_number):
"""
just check that entity_name is correctly parsed and the correct
method is called, but mock out all sql access
......@@ -303,7 +303,7 @@ def test_coriant_info(
'inventory_provider.db.db.connection', mocked_connection)
mocker.patch(
'inventory_provider.db.opsdb.lookup_coriant_path',
lambda a, b, c, d: {'C': a, 'E': b, 'CID': c, 'P': d})
lambda a, b, c, d: {'id': '123', 'C': a, 'E': b, 'CID': c, 'P': d})
rv = client.get(
'/classifier/coriant-info/{equipment}/{entity}'.format(
......@@ -320,6 +320,7 @@ def test_coriant_info(
'card id': card_id,
'port number': port_number,
'path': {
'id': id_,
'C': CONNECTION,
'E': equipment,
'CID': card_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment