diff --git a/inventory_provider/db/opsdb.py b/inventory_provider/db/opsdb.py index a6a041880eb9e5e1c96ce54969c8915d65e15225..fcf6197c777ce300c1bcad69bdc01625d0450124 100644 --- a/inventory_provider/db/opsdb.py +++ b/inventory_provider/db/opsdb.py @@ -537,20 +537,3 @@ def get_service_users(connection, service_ids): crs.execute(query % ','.join([str(x) for x in chunk])) for r in crs.fetchall(): yield {'service_id': r[0], 'user': r[1]} - - -if __name__ == '__main__': - - from inventory_provider.db import db - import json - db_params = { - 'hostname': '83.97.93.8', - 'dbname': 'opsdb', - 'username': 'opsro', - 'password': 'opsro' - } - with db.connection(db_params) as cx: - circuits = get_access_services(cx) - - print(json.dumps(circuits)) - diff --git a/test/test_celery_worker_global.py b/test/test_celery_worker_global.py index 4baa87aac1b86525d33c5bc7a34408a6026a2179..330f8d815e4040eb06abef7d2d0594075e72e41c 100644 --- a/test/test_celery_worker_global.py +++ b/test/test_celery_worker_global.py @@ -40,27 +40,6 @@ def test_update_locations(mocker, mocked_worker_module, mocked_redis): assert len(list(_cached_locations())) > 0 -def test_update_locations(mocker, mocked_worker_module, mocked_redis): - - mocker.patch( - 'inventory_provider.db.opsdb.lookup_pop_info', - lambda c, h: [{'C': c, 'H': h}]) - - def _cached_locations(): - db = backend_db() - for k in db.keys(): - if k.startswith('opsdb:location:'): - yield k - - db = backend_db() - for k in list(_cached_locations()): - del db[k] - - assert len(list(_cached_locations())) == 0 # sanity - worker.update_equipment_locations() - assert len(list(_cached_locations())) > 0 - - def test_access_services(mocker, mocked_worker_module, mocked_redis): opsdb_get_access_services = mocker.patch( diff --git a/test/test_msr_routes.py b/test/test_msr_routes.py index af13f23297a279cf168bae04c966e9147c9a8716..47a9d42e304b2d270c5ea60b6d7a2df09d3a13d8 100644 --- a/test/test_msr_routes.py +++ b/test/test_msr_routes.py @@ -1,6 +1,5 @@ import json import jsonschema -import pytest DEFAULT_REQUEST_HEADERS = { "Content-type": "application/json", @@ -48,4 +47,3 @@ def test_access_services(client): jsonschema.validate(response_data, ACCESS_SERVICES_LIST_SCHEMA) assert response_data # test data is non-empty -