def it_should_create_the_requested_adapter() -> None: a = MainArguments("some/path", DbEngine.MSSQL, LOG_LEVELS[0], "server", "database", 0) a.build_mssql_adapter_with_integrated_security() actual = a.get_db_operations_adapter() assert type(actual) is SqlLmsOperations
def it_should_raise_NotImplementedError() -> None: with pytest.raises(NotImplementedError): a = MainArguments("some/path", DbEngine.MSSQL, LOG_LEVELS[0], "server", "database", 0) a.engine = "PostgreSQL" a.build_mssql_adapter_with_integrated_security() a.get_db_operations_adapter()
def main_arguments(adapter: SqlLmsOperations, csv_path: str) -> MainArguments: args = MainArguments( csv_path, "mssql", "INFO", "localhost", "test_integration_lms_toolkit", 1433, False, False, ) args.build_mssql_adapter_with_integrated_security() # monkey patch the test adapter args.get_db_operations_adapter = lambda: adapter # type: ignore return args