PythonPlacement Classroomnotes 27/Dec/2021

Unit Testing by Example

  • For understanding unit testing better, lets try to write a small application
  • Lets build an application which initially works from command line and later can be used in web frameworks (django, flask)
  • Lets build an application around Inventory Management, with the following features
  • Add/Remove/Edit Products
  • Track Inventory
  • Check and review sales data
  • Add/Remove POS/Transactional users (Staff)
  • Making an Invoice
  • Checking Available products
  • Initially our application will start as a command line Application.
  • Virtual Environment Setup: Lets create a venv for our project
    Preview
  • Configure Visual Studio to use python interpreter from venv. Execute Ctrl+Shift+P
    Preview
    Preview
  • Now Execute Ctrl+Shift+P => Focus Terminal
  • Refer Here for the code changes
  • for code location in GitHub Refer Here

  • Lets try to understand what will be the fields of Product

  • id: This is unique identifier created by us
  • name: This represents name
  • description: This describes the product
  • category: This describes the category of the product
  • mrp: The maximum retail price
  • created_at: created date time
  • updated_at: Last updated date time
  • Refer Here for the changes

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner