jschalk / jaar

Cross-cultural communication engine built on customizable economic systems. Produces personalized agendas, calendars, finance reports for users.
0 stars 1 forks source link

#58 github error fix #374

Closed jschalk closed 2 weeks ago

jschalk commented 2 weeks ago

Summary by Sourcery

Fix the directory path in test cases and add a fixture for environment setup and cleanup.

Bug Fixes:

Tests:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR updates test files to use a fixture for environment setup/cleanup and modifies the fiscal directory path construction to use a function call instead of hardcoded paths.

Sequence diagram for test environment setup and cleanup

sequenceDiagram
    actor Tester
    participant TestFunction
    participant Fixture

    Tester->>TestFunction: Call test_fiscal_build_from_df_ReturnsObj_Scenario0_1FiscalID
    TestFunction->>Fixture: Call brick_env_setup_cleanup
    Fixture-->>TestFunction: Setup environment
    TestFunction-->>Tester: Execute test
    TestFunction->>Fixture: Call brick_env_setup_cleanup
    Fixture-->>TestFunction: Cleanup environment

    Tester->>TestFunction: Call test_fiscal_build_from_df_ReturnsObj_Scenario1_TwoFiscalIDs
    TestFunction->>Fixture: Call brick_env_setup_cleanup
    Fixture-->>TestFunction: Setup environment
    TestFunction-->>Tester: Execute test
    TestFunction->>Fixture: Call brick_env_setup_cleanup
    Fixture-->>TestFunction: Cleanup environment

Class diagram for test fiscal build functions

classDiagram
    class TestFiscalBuild {
        +test_fiscal_build_from_df_ReturnsObj_Scenario0_1FiscalID(brick_env_setup_cleanup)
        +test_fiscal_build_from_df_ReturnsObj_Scenario1_TwoFiscalIDs(brick_env_setup_cleanup)
    }

    note for TestFiscalBuild "Updated to use brick_env_setup_cleanup fixture and dynamic fiscal directory path."

File-Level Changes

Change Details Files
Added test fixture dependency for environment setup and cleanup
  • Added brick_env_setup_cleanup fixture parameter to test functions
  • Maintained existing test logic while adding fixture support
src/f09_brick/test_fiscal_build/test_brick_fiscal_build.py
Updated fiscal directory path construction
  • Replaced hardcoded path '/fizz/fiscals/' with dynamic path using brick_fiscals_dir() function
  • Maintained the '/fizz' suffix in the path construction
src/f09_brick/test_fiscal_build/test_brick_fiscal_build.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. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### 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).