mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 03:23:55 +02:00
Chore/rework workflow (#52)
* Reworked the lint action * Removed the file change requirement * Repaired mypy * Repaired pip-audit
This commit is contained in:
@ -6,22 +6,22 @@ from aki_prj23_transparenzregister.utils.mongo.connector import (
|
||||
)
|
||||
|
||||
|
||||
def test_get_conn_string_no_credentials():
|
||||
def test_get_conn_string_no_credentials() -> None:
|
||||
conn = MongoConnection("localhost", "", 27017, None, None)
|
||||
assert conn.get_conn_string() == "mongodb://localhost:27017"
|
||||
|
||||
|
||||
def test_get_conn_string_no_port_but_credentials():
|
||||
def test_get_conn_string_no_port_but_credentials() -> None:
|
||||
conn = MongoConnection("localhost", "", None, "admin", "password")
|
||||
assert conn.get_conn_string() == "mongodb+srv://admin:password@localhost"
|
||||
|
||||
|
||||
def test_get_conn_simple():
|
||||
def test_get_conn_simple() -> None:
|
||||
conn = MongoConnection("localhost", "", None, None, None)
|
||||
assert conn.get_conn_string() == "mongodb+srv://localhost"
|
||||
|
||||
|
||||
def test_mongo_connector():
|
||||
def test_mongo_connector() -> None:
|
||||
with patch("pymongo.MongoClient") as mock_mongo_client:
|
||||
expected_result = 42
|
||||
mock_mongo_client.return_value = {"db": expected_result}
|
||||
|
Reference in New Issue
Block a user