Giter Site home page Giter Site logo

sap-commissions-pytest's Introduction

SAP Commissions PyTests

Test for various SAP Commissions ODI file templates.

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/niro1987/sapcommissions-pytests
  2. Install requirements:

    python -m pip install -r requirements.txt

Usage

  1. Place your ODI files in the source directory.

  2. Run tests.

    python -m pytest

A detailed report is generated at ./report.html.

Visual Studio Code

The repository is configured to work with VSCode. Open Test Explorer using the icon
on the Activity Bar. Running tests this way will not generate an html report.

Contribute

I encourage anyone to write additional tests for their respective ODI templates. Fork the repository to make your changes and open a pull request to get your changes merged.

Each test files should include a pytest marker to exlude the entire module if no files for the specific template are found in the source folder.

from .common import source_files

pytestmark = pytest.mark.skipif(
    len(source_files('TEMPLATE')) == 0,
    reason=f"No files found for this ODI template."
)

Inherrit from common.GenericTests to include tests that any ODI template should pass. GenericTests expects some class variables to be included, see example below.

from .common import GenericTests

class TestMyTemplate(GenericTests)
    """Tests for MyTemplate."""

    template: str = "MY_TEMPLATE"
    primary_key: list[str] = [] # Columns that make the row unique in the file.
    required: list[str] = [] # Columns that are required to be filled.
    numbers: list[str] = [] # Number columns, joined by UNITTYPEFOR... columns.
    dates: list[str] = [] # Date columns, MM/DD/YYYY format.
    booleans: list[str] = [] # Boolean columns, can only contain NULL, 0 or 1.

sap-commissions-pytest's People

Contributors

niro1987 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.