jhanley634 / dojo-blackboard

An HTMX webserver for the Dojo's Tuesday night python meetups.
MIT License
3 stars 1 forks source link

25 timer cleanup #26

Closed jhanley634 closed 1 month ago

jhanley634 commented 1 month ago

Now it lints clean, and $ make test reports 100% code coverage.

Summary by Sourcery

Clean up the timer functionality by adding a test for the stop_watch function and renaming the endpoint to /demo/timer for improved clarity. Ensure the codebase is lint-free and achieves 100% test coverage.

New Features:

Enhancements:

Tests:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request focuses on cleaning up the timer functionality and improving test coverage. The changes include renaming an endpoint, adding a new test case, and making minor adjustments to improve code quality and consistency.

Sequence diagram for the updated timer endpoint

sequenceDiagram
    actor User
    participant App
    participant TimerModule as Timer Module

    User->>App: GET /demo/timer
    App->>TimerModule: Call stop_watch()
    TimerModule-->>App: Return HTMLResponse
    App-->>User: Display timer in seconds

Updated class diagram for the clock display module

classDiagram
    class ClockDisplay {
        +clock_display() str
        +clock_reading() str
        +stop_watch() str
    }

    class ClockDisplayTest {
        +test_clock_display() void
        +test_stop_watch() void
    }

    ClockDisplayTest --> ClockDisplay

File-Level Changes

Change Details Files
Renamed the stop watch endpoint from '/demo/stop_watch' to '/demo/timer'
  • Updated the endpoint route in main.py
  • Added a comment about function names matching endpoint names
src/bboard/main.py
Added a new test case for the stop_watch function
  • Imported stop_watch function in the test file
  • Created a new test method test_stop_watch
  • Added an assertion to check the length of the stop_watch output
tests/clock_display_test.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).