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

Fix/add mongomock unittests #86

Merged
merged 4 commits into from
Jul 14, 2024
Merged

Fix/add mongomock unittests #86

merged 4 commits into from
Jul 14, 2024

Conversation

wderocco8
Copy link
Contributor

What does this PR do?

Added more unit tests to the backend and integrated support for MongoDB testing with mongomock library.

Type of change

  • Fix: Bug fix (non-breaking change which fixes an issue)
  • Refactor: Any code refactoring
  • Chore: technical debt, workflow improvements
  • Feature: New feature (non-breaking change which adds functionality)
  • Documentation: This change requires a documentation update
  • Merge: Pushing features to an upper envrironment

Tests Performed

Screenshots

Additional Comments

@wderocco8 wderocco8 added fix improvement Enhancements labels Jul 14, 2024
@wderocco8 wderocco8 requested a review from jinyoungbang July 14, 2024 18:52
Copy link

github-actions bot commented Jul 14, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1811 1357 75% 70% 🟢

New Files

File Coverage Status
tests/services/test_event_service.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
chalicelib/modules/mongo.py 24% 🟢
chalicelib/services/EventService.py 26% 🟢
TOTAL 25% 🟢

updated for commit: 3a966a3 by action🐍

Copy link
Contributor

@jinyoungbang jinyoungbang left a comment

Choose a reason for hiding this comment

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

LGTM! Maybe make that one change that I commented. Thank you for the unit tests :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a ternary operator!

def __init__(self, use_mock=False):
    """Establishes connection to MongoDB server"""
    self.mongo_client = mongomock.MongoClient() if use_mock else MongoClient(self.uri)

@wderocco8 wderocco8 merged commit ce8b8fd into main Jul 14, 2024
1 check passed
@wderocco8 wderocco8 deleted the fix/add-mongomock-unittests branch July 14, 2024 19:01
@wderocco8 wderocco8 restored the fix/add-mongomock-unittests branch July 14, 2024 19:02
@jinyoungbang jinyoungbang mentioned this pull request Jul 14, 2024
6 tasks
@wderocco8 wderocco8 deleted the fix/add-mongomock-unittests branch July 20, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants