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

added test of latchdb route

parent 561b3daf
Branches
Tags
No related merge requests found
import json
import jsonschema
from inventory_provider.tasks.common import DB_LATCH_SCHEMA
DEFAULT_REQUEST_HEADERS = {
"Content-type": "application/json",
"Accept": ["application/json"]
......@@ -123,3 +124,13 @@ def test_check_task_status_exception(client, mocker):
assert not status['success']
assert status['result']['error type'] == 'AssertionError'
assert status['result']['message'] == 'test error message'
def test_latchdb(client, mocked_redis):
rv = client.post(
'jobs/latchdb',
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
latch = json.loads(rv.data.decode('utf-8'))
jsonschema.validate(latch, DB_LATCH_SCHEMA)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment