macxred / pyledger

Python package to streamline the implementation and management of accounting systems.
MIT License
0 stars 0 forks source link

Develop Base Test Logic for Integration Tests #24

Open AlexTheWizardL opened 1 week ago

AlexTheWizardL commented 1 week ago

Description:

The goal is to create a universal testing approach that covers functionality common to every ledger system. Applying these tests to existing software, such as CashCtrlLedger, will validate the tests and ensure consistent behavior across all systems. This will involve defining test data, expected outcomes, restoring ledger states, and implementing both integration and unit tests to guarantee consistency and correctness across different implementations.

General Test Flow:

  1. Define Test Data:

    • Define mock data representing the ledger system state. On this step, Lukas' input is needed to help define robust test data.
  2. Define Expected Outcome:

    • For each test case, specify the expected results, such as correct account balances, VAT amounts, or ledger entries after transactions. This step also involves Lukas' input to define proper data.
  3. Populate Ledger System with Predefined Data:

    • Use the implemented method to initialize the ledger system state from the predefined test data. This will be useful, especially using pytest fixtures.
  4. Implement Integration Tests:

    • Start by testing high-level functionality to ensure that the StandaloneLedger processes operations correctly.
    • Gradually add unit tests to validate individual methods and components, ensuring comprehensive test coverage.
  5. Restore Initial State:

    • Restore the initial state of the ledger system using dump and restore logic within a fixture.

Testing Strategy: