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

removed unecessary mock

parent be85be15
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,10 @@ ...@@ -2,13 +2,10 @@
just checks that the worker methods call the right functions just checks that the worker methods call the right functions
and some data ends up in the right place ... otherwise not very detailed and some data ends up in the right place ... otherwise not very detailed
""" """
import contextlib
import os import os
from inventory_provider.tasks import worker from inventory_provider.tasks import worker
from inventory_provider.tasks import common from inventory_provider.tasks import common
from inventory_provider.tasks.common import _get_redis from inventory_provider.tasks.common import _get_redis
...@@ -22,19 +19,11 @@ def backend_db(): ...@@ -22,19 +19,11 @@ def backend_db():
}).db }).db
@contextlib.contextmanager
def _mocked_connection(x):
yield x
def test_update_locations(mocker, mocked_worker_module, mocked_redis): def test_update_locations(mocker, mocked_worker_module, mocked_redis):
mocker.patch( mocker.patch(
'inventory_provider.db.opsdb.lookup_pop_info', 'inventory_provider.db.opsdb.lookup_pop_info',
lambda c, h: [{'C': c, 'H': h}]) lambda c, h: [{'C': c, 'H': h}])
mocker.patch(
'inventory_provider.db.db.connection',
_mocked_connection)
def _cached_locations(): def _cached_locations():
db = backend_db() db = backend_db()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment