Code Monkey home page Code Monkey logo

oc-calculatrice's Introduction

forthebadge forthebadge

Mini-Projet Calculatrice

Ce projet a été implémenté dans le but de s'entrainer au test unitaire à l'aide Pytest et UnitTest. Le code source contient un mini-projet calculatrice qui permet d'effectuer 4 opérations différentes (addition, soustraction, multiplication et division). Vous pourrez ainsi développer l'ensemble des scénarios nécessaires afin de tester l'ensemble du code source. À noter que des propositions de corrections sont mises à disposition dans différentes branches du répertoire.

Pré-requis

Installation

1. Télécharger le projet sur votre répertoire local :

git clone https://github.com/OpenClassrooms-Student-Center/4425126-testing-python.git 
cd 4425126-testing-python

2. Mettre en place un environnement virtuel :

  • Créer l'environnement virtuel: python -m venv venv
  • Activer l'environnement virtuel :
    • Windows : venv\Scripts\activate.bat
    • Unix/MacOS : source venv/bin/activate

3. Installer les dépendances du projet

pip install -r requirements.txt

Démarrage

  • Lancer le script à l'aide de la commande suivante : python main.py

Corrections

  1. Proposition de correction pour les tests unitaires avec UnitTest :
git checkout unittest-test
python -m unittest discover tests/
  1. Proposition de correction pour les tests unitaires avec Pytest :
git checkout pytest-test
pytest
  1. Proposition de correction pour les mocks avec Pytest:
git checkout mock-test
pytest
  1. Proposition de correction pour les tests paramétriques Pytest :
git checkout parametrize-test
pytest

oc-calculatrice's People

Contributors

slb59 avatar ranga-gonnage 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.