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

Fixed the test cases #112

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

tannuiscoding
Copy link
Contributor

@tannuiscoding tannuiscoding commented Oct 12, 2024

Title of the Pull Request

  • Have you renamed the PR Title in a meaningful way?

Related Issue

closes #111

Description

I changed the test cases of models.py and piechart.py according to the new features and they are running perfectly fine.

I did not work on the test cases of graph.py ass those test cases and features are still left to be fixed.

test cases results for model.py

Screenshot 2024-10-12 175228

test cases result graph.py

image

Type of change

What sort of changes have you made:

class MockDateTime(datetime):
    @classmethod
    def now(cls):
        return datetime.strptime("1234", "%H%M")

def mock_copyfile(src, dst):
    pass  

def mock_glob_single(pattern):
    return ["stash/test.py"]

def mock_glob_none(pattern):
    return []

def mock_glob_multiple(pattern):
    return ["stash/test.py", "stash/test2.py"]

All the test cases are working good and the issues are fixed. please review them and let me know if any changes are required.

Thank you!!

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the code style of this project.
  • I have followed the contribution guidelines
  • I have performed a self-review of my own code.
  • I have ensured my changes don't generate any new warnings or errors.
  • I have updated the documentation (if necessary).
  • I have resolved all merge conflicts.

Copy link
Collaborator

@ShashwatAgrawal20 ShashwatAgrawal20 left a comment

Choose a reason for hiding this comment

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

MAKE SURE YOU'RE FORMATTING YOUR CODE.

And just a quick-fix for the file tests/test_graph.py as this PR is related to test cases it can be get fixed too.

  1. You can use a single import statement for importing both display and copy_to_clipboard something like from package.graph import copy_to_clipboard, display currently the code uses 2 different import statement.
  2. we don't need these imports there os, sys and shutil as we aren't using those in that file.
  3. That assert statement should be something like assert display("test",current_time) is None instead of using ==
  4. And the last except statement should be a f-string as it complains about e is assigned but never used. pytest.fail(f"Unexpected error raised: {e}")

tests/test_models.py Outdated Show resolved Hide resolved
tests/test_piechart.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@this-is-yaash this-is-yaash left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@jindalpriyanshu101 jindalpriyanshu101 left a comment

Choose a reason for hiding this comment

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

LGTM!, Approved.

Copy link
Collaborator

@ShashwatAgrawal20 ShashwatAgrawal20 left a comment

Choose a reason for hiding this comment

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

LGTM!

shipit

@this-is-yaash this-is-yaash merged commit 0e345fd into AmateursLeague:main Oct 13, 2024
1 check failed
@this-is-yaash this-is-yaash added gssoc-ext Issues labelled only for GSSoC'24 Extended Edition level2 Issues that are medium difficulty to fix hacktoberfest-accepted hacktoberfest 2024 Assigned Indicates that issue is now assigned. labels Oct 13, 2024
@tannuiscoding tannuiscoding deleted the test_cases_fixed branch October 19, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assigned Indicates that issue is now assigned. gssoc-ext Issues labelled only for GSSoC'24 Extended Edition hacktoberfest-accepted hacktoberfest 2024 level2 Issues that are medium difficulty to fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Cases: Fixed
4 participants