+1(805) 568 7317

1 please write a python 3 program and show all outputs please separate files also se 5148678

1. Please write a python 3 program and show all outputs.


Complete the TODOs in waterregulation/ and waterregulation/
Complete the TODOs in waterregulation/ and waterregulation/ A single integration test may be sufficient. However, your unit tests in should include at least one test for each specified behavior.

python -m unittest waterregulation/ and python -m unittest waterregulation/ should have no failures.
Running coverage run –source=waterregulation/,waterregulation/ -m unittest waterregulation/; coverage report shows 90%+ coverage..
Satisfy the linter such that pylint waterregulation gives no errors and and flake8 waterregulation gives no errors. You may have to add docstrings to your test files.


Example Test for this program from part one. This is only an example of orginal instructions and output code.

Original Instructions

python -m unittest integration-test should have no failures. Don't edit, edit your code to make it pass.
Add unit tests to such that coverage run –source=calculator -m unittest unit-test; coverage report shows 100% coverage.
All of the tests in should pass.
Satisfy the linter such that pylint calculator gives no errors and flake8 calculator gives no errors. See (PEP257)[] if you'd like more information about docstrings. There are quite a few docstrings to add, but for this exercise you don't need to get too creative: “”” this method adds two numbers “”” is sufficient.

Bonus goal

One of our specs for calculator says the following:

The add, subtract, multiply, and divide methods shall both:
Return the result of the operation
Enter the result of the operation back into the calculator
This makes it possible to perform the following sequences of operations:
calculator.add()                      # Returns 5, and now 5 is now 'in the calculator'
calculator.subtract()               # Returns 4 because 5 – 1 = 4

“””calculator functions”””

def add(x, y):

    “”” Add two numbers

    >>> add(1, 2)


    >>> add(-7, 2)



    return int(x) + int(y)

#!/usr/bin/env python3


    Usage: 1 + 3




test1=”2 + 3″

test2=”2 – 3″


import unittest

from test_calculator import TestCalculatorFunctions

suite = unittest.TestLoader().loadTestsFromTestCase(TestCalculatorFunctions)



import unittest

import calculator_functions as calc


#!/use/bin/env python
tests for the calculator module
designed to be run with pytest

import pytest
import calculator_functions as calc

# a very simple test

def test_add():

    assert calc.add(2, 3) == 5

# testing with a variety of parameters:

def test_multiply_ugly():


    the ugly, not very robust way….


    assert calc.multiply(2, 2) == 4

    assert calc.multiply(2, -1) == -2

    assert calc.multiply(-2, -3) == 6

    assert calc.multiply(3, 0) == 0

    assert calc.multiply(0, 3) == 0

param_names = “arg1, arg2, result”

params = [(2, 2, 4),

          (2, -1, -2),

          (-2, -2, 4),

          (3, 0, 0),


@pytest.mark.parametrize(param_names, params)

def test_multiply(arg1, arg2, result):

    assert calc.multiply(arg1, arg2) == result

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon

Order Now