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

pep8

parent 76f6a6b8
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......@@ -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(
......
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
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