Skip to content

Commit

Permalink
#150: Add test for backend creation
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Nov 11, 2020
1 parent f4ef19f commit 55397e5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/icat/test_backends.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest

from datagateway_api.common.backends import create_backend
from datagateway_api.common.database.backend import DatabaseBackend
from datagateway_api.common.icat.backend import PythonICATBackend


class TestBackends:
@pytest.mark.parametrize(
"backend_name, backend_type",
[
pytest.param("db", DatabaseBackend, id="Database Backend"),
pytest.param("python_icat", PythonICATBackend, id="Python ICAT Backend"),
],
)
def test_backend_creation(self, backend_name, backend_type):
test_backend = create_backend(backend_name)

assert type(test_backend) == backend_type

0 comments on commit 55397e5

Please sign in to comment.