Skip to main content

A package for unittest

Project description

fhm-unittest

A package for unittest. It will take two parameters where the first parameter will be the returned value and the second parameter will be the expected value.

Installation Instructions

Using PIP via PyPI

pip install fhm-unittest

for installing on Google Colab:

! pip3 install fhm-unittest

Usage

>>> import fhm_unittest as unittest

To test a function, call the output_test function as pass your returned value and expected value as parameters

>>> unittest.output_test(returned value, expected value)

Example - 01

def even_odd_checker(number):
  if number % 2 == 0:
    return 'The number is even'
  else:
    return 'The number is odd'
>>> unittest.output_test(even_odd_checker(10), 'The number is even')
    Accepted

Example - 02

def even_odd_checker(number):
  if number % 2 == 0:
    return 'even'
  else:
    return 'odd'
>>> unittest.output_test(even_odd_checker(10), 'The number is even')
    Not Accepted [Your output: even  |  Expected Output: The number is even]

Example - 03

def even_odd_checker(number):
  if number % 2 == 0:
    return 'even'
  else:
    return 'odd'
>>> unittest.output_test(even_odd_checker(10), 'The number is odd')
    Wrong Answer [Your output: even  |  Expected Output: The number is odd]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fhm_unittest-1.0.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

fhm_unittest-1.0.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page