mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context This replaces passing Logger instances as arguments around with the preferred Python way of having each module define a module-wide `logger` instance at the top of the module. Fixes #3711 ### Description Removes any `log` argument and argument documentation. Replaces usage of those `log` arguments with the module-wide `logger` instance. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Eduard van Valkenburg <[email protected]>
23 lines
533 B
Python
23 lines
533 B
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
from pytest import raises
|
|
|
|
from semantic_kernel.template_engine.blocks.block import Block
|
|
from semantic_kernel.template_engine.blocks.block_types import BlockTypes
|
|
|
|
|
|
def test_init():
|
|
block = Block(content="test content")
|
|
assert block.content == "test content"
|
|
|
|
|
|
def test_type_property():
|
|
block = Block()
|
|
assert block.type == BlockTypes.UNDEFINED
|
|
|
|
|
|
def test_is_valid_not_implemented():
|
|
block = Block()
|
|
with raises(NotImplementedError):
|
|
block.is_valid()
|