Skip to content
Snippets Groups Projects
Commit de9de20d authored by Cyril Danilevski's avatar Cyril Danilevski :scooter:
Browse files

Add test for webservice.merge

parent 5b733dde
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ from pathlib import Path ...@@ -4,7 +4,7 @@ from pathlib import Path
import pytest import pytest
sys.path.insert(0, Path(__file__).parent / 'webservice') 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(): def test_check_files():
...@@ -23,3 +23,16 @@ def test_check_files(): ...@@ -23,3 +23,16 @@ def test_check_files():
with pytest.raises(PermissionError): with pytest.raises(PermissionError):
in_folder = '/gpfs/maxwell/home/achilles' # arbitrarily chosen in_folder = '/gpfs/maxwell/home/achilles' # arbitrarily chosen
check_files(in_folder, runs, karabo_das) 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
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