From de9de20d02b46ba680d0be9d401998444dc272e7 Mon Sep 17 00:00:00 2001 From: Cyril Danilevski <cyril.danilevski@xfel.eu> Date: Fri, 12 Feb 2021 14:03:53 +0100 Subject: [PATCH] Add test for webservice.merge --- tests/test_webservice.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/test_webservice.py b/tests/test_webservice.py index 1497d9e20..7a67cf530 100644 --- a/tests/test_webservice.py +++ b/tests/test_webservice.py @@ -4,7 +4,7 @@ from pathlib import Path import pytest sys.path.insert(0, Path(__file__).parent / 'webservice') -from webservice.webservice import check_files # noqa +from webservice.webservice import check_files, merge # noqa def test_check_files(): @@ -23,3 +23,16 @@ def test_check_files(): with pytest.raises(PermissionError): in_folder = '/gpfs/maxwell/home/achilles' # arbitrarily chosen check_files(in_folder, runs, karabo_das) + + +def test_merge(): + a = {'some': {'key': {'akey': 'avalue', 'number': 1}}} + b = {'some': {'key': {'anotherkey': 'anothervalue', 'number': 5}}, + 'completely': 'different'} + + ret = merge(a, b) + expected = {'some': {'key': {'akey': 'avalue', + 'anotherkey': 'anothervalue', + 'number': 1}}, + 'completely': 'different'} + assert ret == expected -- GitLab