I have two codes. One is validator and another is main code. Please make the main code follow requirement of validator like assertation. requirenment.
I have two codes. One is validator and another is main code. Please make the main code follow requirement of validator like assertation. requirenment.
Validator:---------
@points(5)
def test_flour_sack():
"""Testing flour_sack"""
module = import_file("pizza.py")
_test_ingredient(module.flour_sack, "flour")
@points(5)
def test_yeast_jar():
"""Testing yeast_jar"""
module = import_file("pizza.py")
_test_ingredient(module.yeast_jar, "yeast")
@points(5)
def test_salt_shaker():
"""Testing salt_shaker"""
module = import_file("pizza.py")
_test_ingredient(module.salt_shaker, "salt")
Main code:------
from time import time
def flour_sack(capacity=10):
for i in range(capacity):
yield 'flour '
def yeast_jar(capacity=20):
for i in range(capacity):
yield 'yeast '
def salt_shaker(capacity=100):
for i in range(capacity):
yield 'salt '
def water_faucet():
while True:
yield 'water'
if __name__ == "__main__":
pass
Step by step
Solved in 2 steps