Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wderocco8
Copy link
Member

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
@github-actions
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
@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.

3 participants