Skip to content

Test split integer#2154

Open
miroslavbro47-alt wants to merge 1 commit into
mate-academy:masterfrom
miroslavbro47-alt:develop
Open

Test split integer#2154
miroslavbro47-alt wants to merge 1 commit into
mate-academy:masterfrom
miroslavbro47-alt:develop

Conversation

@miroslavbro47-alt

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This is an educational approval to support your learning progress.

What's working well: Your tests successfully verify the core functionality — split results sum correctly, and parts are properly sorted. Test naming is descriptive and file structure follows requirements.

Areas to improve:

  • Two tests create unnecessary variables before assertion (e.g., result = split_integer(...) followed by assert result == ...). Per [CHECKLIST ITEM #1], you can compare directly: assert split_integer(value, n) == expected_result
  • A key requirement is missing: the description states "the difference between max and min should be <= 1", but no test validates this constraint — consider adding a test like test_max_min_difference_should_be_one_or_less

These are focused improvements for a solid foundation. You're on the right track!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread app/test_split_integer.py
Comment on lines 4 to +5
def test_sum_of_the_parts_should_be_equal_to_value() -> None:
pass
result = split_integer(10, 2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates an unnecessary variable. Per checklist item #1, compare the result directly in assert for simple tests.

Comment thread app/test_split_integer.py
Comment on lines 17 to +18
def test_parts_should_be_sorted_when_they_are_not_equal() -> None:
pass
result = split_integer(17, 4)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates an unnecessary variable. Per checklist item #1, compare the result directly in assert for simple tests.

Comment thread app/test_split_integer.py
Comment on lines 16 to +19

def test_parts_should_be_sorted_when_they_are_not_equal() -> None:
pass
result = split_integer(17, 4)
assert result == sorted(result)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description explicitly requires that 'the difference between the max and min number in the array should be <= 1'. No test validates this constraint. Consider adding a test like test_max_min_difference_should_not_exceed_one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants