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

a couple more tests for coverage

parent b389760e
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ import contextlib
import os
from inventory_provider.tasks import worker
from inventory_provider.tasks import common
from inventory_provider.tasks.common import _get_redis
......@@ -50,7 +52,26 @@ def test_update_locations(mocker, mocked_worker_module, mocked_redis):
def test_InventoryTask_obj(data_config_filename):
os.environ['INVENTORY_PROVIDER_CONFIG_FILENAME'] = data_config_filename
task = worker.InventoryTask()
assert task.config
def test_next_redis(data_config, mocked_redis):
common.set_latch(data_config, 10, 20)
r = common.get_next_redis(data_config)
assert r
# there's only one ...
latch = common.get_latch(r)
assert latch['current'] == 10
assert latch['next'] == 20
def test_next_redis_with_none(data_config, mocked_redis):
r = common._get_redis(data_config)
assert r
del r.db['db:latch'] # cf. conftest:MockedRedis
r = common.get_next_redis(data_config)
assert r
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