Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/34 introduce unit tests for generator #67

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

MobiTikula
Copy link
Collaborator

@MobiTikula MobiTikula commented Nov 13, 2024

Unit tests using Pytest for generator.py and main.py.

Release Notes:

  • Implemented unit tests using Pytest for generator.py and main.py (project code-cov at (96 %).

Closes #34

@MobiTikula MobiTikula added the enhancement New feature or request label Nov 13, 2024
@MobiTikula MobiTikula self-assigned this Nov 13, 2024
@MobiTikula MobiTikula linked an issue Nov 13, 2024 that may be closed by this pull request
Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

  • pulled
  • local run
  • unit test run
    Missing tests:
  • action_input: I would cover three static methods by tests to check default values expected by documentation.
  • github_projects: I would propose new issue to implement Integration test - testing current branch code for mining with full features enabled (result can be empty, it depends - it is not exact counting test)

@@ -1,7 +1,7 @@
[tool.black]
line-length = 120
target-version = ['py311']
force-exclude = '''test'''
#force-exclude = '''test'''
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#force-exclude = '''test'''
force-exclude = '''test'''

mock_logger_info = mocker.patch("living_documentation_generator.generator.logger.info")
mock_logger_debug = mocker.patch("living_documentation_generator.generator.logger.debug")

issue_mock = mocker.Mock()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
issue_mock = mocker.Mock()
mock_issue = mocker.Mock()

Copy link
Collaborator

Choose a reason for hiding this comment

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

When mocking then keep the same format.

project_issue_2 = mocker.Mock(spec=ProjectIssue)
project_issue_2.organization_name = "OrgA"
project_issue_2.repository_name = "RepoA"
project_issue_2.number = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
project_issue_2.number = 1
project_issue_2.number = 2

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here I am a little bit confused - Issue in same repo with two states? As I understand the test code you want to simulate two project issues for two issues right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Unit Tests and Code Coverage
2 participants