mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-22 22:02:54 +02:00
- [x] add a cli to the webserver to take env variables into account - [x] add a cli to the data processing that takes enviromental variable as a valid source into account - [x] rework the cli for the reset sql command - [x] rework the cli for the copying of sql data from one db to another
17 lines
605 B
Python
17 lines
605 B
Python
"""Tests for connecting to the mongodb."""
|
|
from unittest.mock import patch
|
|
|
|
from aki_prj23_transparenzregister.config.config_template import MongoConnection
|
|
from aki_prj23_transparenzregister.utils.mongo.connector import (
|
|
MongoConnector,
|
|
)
|
|
|
|
|
|
def test_mongo_connector() -> None:
|
|
"""Tests the MongoConnector."""
|
|
with patch("pymongo.MongoClient") as mock_mongo_client:
|
|
expected_result = 42
|
|
mock_mongo_client.return_value = {"db": expected_result}
|
|
temp = MongoConnector(MongoConnection("localhost", "db", None, None, None))
|
|
assert temp.database == expected_result
|