Skip to content

Instantly share code, notes, and snippets.

@twyle
Last active May 29, 2022 07:57
Show Gist options
  • Save twyle/c302cb891454c69441917657d2def731 to your computer and use it in GitHub Desktop.
Save twyle/c302cb891454c69441917657d2def731 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""This module tests the three functions in the src package."""
from src.math import add, multiply, subtract
def test_add():
"""Test that add() function correctly sums two integers.
GIVEN the add() function
WHEN inputs are 2 and 3
THEN it should return 5
"""
assert add(3, 2) == 5
def test_subtract():
"""Test that subtract() function correctly subtracts two integers.
GIVEN the subtract() function
WHEN inputs are 3 and 2
THEN it should return 1
"""
assert subtract(3, 2) == 1
def test_multiply():
"""Test that mutiply() function correctly mutiplies two integers.
GIVEN the mutiply() function
WHEN inputs are 2 and 3
THEN it should return 6
"""
assert multiply(3, 2) == 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment