Skip to content

Commit

Permalink
Error correction for ColemanLiauIndex_test.py::test_call
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusOmbok committed Aug 29, 2024
1 parent ddf0401 commit ead5a5a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/tools/ColemanLiauIndex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,17 @@ def test_initialization():
@pytest.mark.unit
def test_call():
tool = Tool()
assert tool(10, 10) == str(20)
# Example input text for CLI calculation
input_data = {"input_text": "This is a simple test text. It contains two sentences."}

# Calculating expected CLI score manually
num_sentences = 2
num_words = 10
num_characters = 42

L = (num_characters / num_words) * 100
S = (num_sentences / num_words) * 100
expected_cli_score = 0.0588 * L - 0.296 * S - 15.8

# Assert that the CLI tool calculates the expected value
assert tool(input_data) == pytest.approx(expected_cli_score, 0.01)

0 comments on commit ead5a5a

Please sign in to comment.