Exemple #1
0
def exactChange9999(test):
    test.test = lambda: assertlib.numberOnLine(
        39996, lib.getLine(lib.outputOf(_fileName, [9999]), 0))
    test.description = lambda: "9999$ in change equals 39996 coins"
Exemple #2
0
def exactWater10(test):
    test.test = lambda: assertlib.numberOnLine(
        120, lib.getLine(lib.outputOf(_fileName, stdinArgs=[10]), 0))
    test.description = lambda: "10 minutes in the shower is 120 bottles of water"
Exemple #3
0
def exactWater327(test):
    test.test = lambda: assertlib.numberOnLine(
        3924, lib.getLine(lib.outputOf(_fileName, stdinArgs=[327]), 0))
    test.description = lambda: "327 minutes equals 3924 water bottles"
Exemple #4
0
def exactZeroPoint(test):
    test.test = lambda : assertlib.numberOnLine(0.37, lib.getLine(lib.outputOf(_fileName), 0), deviation = 0.01)\
            and assertlib.numberOnLine(0.69, lib.getLine(lib.outputOf(_fileName), 0), deviation = 0.01)
    test.description = lambda: "prints the intersects of the axes (x = 0.37 and y = 0.69)"
Exemple #5
0
def correctSpeed(test):
    test.test = lambda: assertlib.numberOnLine(
        159.5, lib.getLine(lib.outputOf(_fileName), 1), deviation=0.1)
    test.description = lambda: "prints the speed with which the apple touches the ground"
def correctAmount(test):
    test.test = lambda: assertlib.numberOnLine(
        math.e, lib.getLine(lib.outputOf(_fileName), 0), deviation=0.0027)
    test.description = lambda: "Geeft de correcte gemiddeld aantal worpen"
Exemple #7
0
def correctTimeTillReturn(test):
	test.test = lambda : assertlib.numberOnLine(5061, lib.getLine(lib.outputOf(_fileName), 1), deviation = 50)
	test.description = lambda : "prints the number of seconds elapsed upon return"
Exemple #8
0
def correctTimeTillReturn(test):
    test.test = lambda: assertlib.numberOnLine(
        5061, lib.getLine(lib.outputOf(_fileName), 1), deviation=50)
    test.description = lambda: "print het tijdstip van terugkeer na loslaten"
Exemple #9
0
def correctDistance(test):
    test.test = lambda: assertlib.numberOnLine(
        35, lib.getLine(lib.outputOf(_fileName), 1))
    test.fail = lambda info: "is it printed on a separate second line?"
    test.description = lambda: "prints the correct length of the sequence"
Exemple #10
0
def exactChange0(test):
    test.test = lambda: assertlib.numberOnLine(
        0, lib.getLine(lib.outputOf(_fileName, [0]), 0))
    test.description = lambda: "0$ in change equals 0 coins"
Exemple #11
0
def correctMaxSpeed(test):
    test.test = lambda: assertlib.numberOnLine(
        28474.32, lib.getLine(lib.outputOf(_fileName), 0), deviation=500)
    test.description = lambda: "print de maximale snelheid van de appel"
Exemple #12
0
def handlesWrongInput(test):
    test.test = lambda: assertlib.numberOnLine(
        0, lib.getLine(lib.outputOf(_fileName, [-9.50, -327, 0]), 0))
    test.description = lambda: "is able to deal with the following erroneous input: -9.50 and -327"
Exemple #13
0
def exactChange35(test):
    test.test = lambda: assertlib.numberOnLine(
        2, lib.getLine(lib.outputOf(_fileName, [0.35]), 0))
    test.description = lambda: "0.35$ in change equals 2 coins"
Exemple #14
0
def exactChange402(test):
    test.test = lambda: assertlib.numberOnLine(
        18, lib.getLine(lib.outputOf(_fileName, [4.02]), 0))
    test.description = lambda: "4.02$ in change equals 18 coins"
Exemple #15
0
def handlesWrongInput(test):
	test.test = lambda : assertlib.numberOnLine(2, lib.getLine(lib.outputOf(_fileName, [-90, -1, 0, 1]), 0))
	test.description = lambda : "handelt foute input af: -90, -1, 0"
Exemple #16
0
def correctBelow40(test):
    tsts = ['40', 'veertig', 'forty']
    test.test = lambda : (assertlib.numberOnLine(5, lib.getLine(lib.outputOf(_fileName), 0), deviation = 5) or assertlib.numberOnLine(0.05, lib.getLine(lib.outputOf(_fileName), 0), deviation = 0.05)) and sum([assertlib.contains(lib.outputOf(_fileName), tst) for tst in tsts])
    test.fail = lambda info : "make sure you output a sentence containing the answer on the first line of output"
    test.description = lambda : "prints, on the first line, how often the sum is less than 40"
Exemple #17
0
def exact1(test):
	test.test = lambda : assertlib.numberOnLine(2, lib.getLine(lib.outputOf(_fileName, [1]), 0))
	test.description = lambda : "vind het 1ste priemgetal: 2"
Exemple #18
0
def correctAbove60(test):
	tsts = ['60', 'zestig', 'sixty']
	test.test = lambda : (assertlib.numberOnLine(5, lib.getLine(lib.outputOf(_fileName), 1), deviation = 5) or assertlib.numberOnLine(0.05, lib.getLine(lib.outputOf(_fileName), 1), deviation = 0.05))and sum([assertlib.contains(lib.outputOf(_fileName), tst) for tst in tsts])
	test.fail = lambda info : "make sure you output a sentence containing the answer on the second line of output"
	test.description = lambda : "prints, on the first line, how often the sum is more than 60"
Exemple #19
0
def correctMaxSpeed(test):
	test.test = lambda : assertlib.numberOnLine(28474.32, lib.getLine(lib.outputOf(_fileName), 0), deviation = 500)
	test.description = lambda : "prints the maximum speed reached by the apple"
Exemple #20
0
def exactChange16(test):
    test.test = lambda: assertlib.numberOnLine(
        7, lib.getLine(lib.outputOf(_fileName, stdinArgs=[1.6]), 0))
    test.description = lambda: "input of 1.6 yields output of 7"
Exemple #21
0
def correctDistance(test):
    test.test = lambda: assertlib.numberOnLine(
        35, lib.getLine(lib.outputOf(_fileName), 1))
    test.description = lambda: "geeft de correcte lengte van de reeks"
Exemple #22
0
def exactChange420(test):
    test.test = lambda: assertlib.numberOnLine(
        18, lib.getLine(lib.outputOf(_fileName, stdinArgs=[4.2]), 0))
    test.description = lambda: "input of 4.2 yields output of 18"
    test.fail = lambda info: "did you forget to round your input to the nearest cent?"
Exemple #23
0
def correctTime(test):
    test.test = lambda: assertlib.numberOnLine(
        4.51, lib.getLine(lib.outputOf(_fileName), 0), deviation=0.01)
    test.description = lambda: "prints the number of seconds after which the apple touches the ground"
Exemple #24
0
def exactChange0(test):
    test.test = lambda: assertlib.numberOnLine(
        0, lib.getLine(lib.outputOf(_fileName, stdinArgs=[0]), 0))
    test.description = lambda: "input of 0 yields output of 0"
Exemple #25
0
def correctSecondsToHit100(test):
    test.test = lambda: assertlib.numberOnLine(
        2.83, lib.getLine(lib.outputOf(_fileName), 2), deviation=0.01)
    test.description = lambda: "prints the number of seconds after which the speed reaches 100 km/h"
Exemple #26
0
def exact1000(test):
	test.test = lambda : assertlib.numberOnLine(7919, lib.getLine(lib.outputOf(_fileName, [1000]), 0))
	test.description = lambda : "vind het 1000ste priemgetal: 7919"
Exemple #27
0
def exactWater327(test):
    test.test = lambda: assertlib.numberOnLine(
        3924, lib.getLine(lib.outputOf(_fileName, stdinArgs=[327]), 0))
    test.description = lambda: "0 minutes in the shower is 3924 bottles of water"
Exemple #28
0
def exact377(test):
	test.test = lambda : assertlib.numberOnLine(2591, lib.getLine(lib.outputOf(_fileName, [377]), 0))
	test.description = lambda : "vind het 377ste priemgetal: 2591"
Exemple #29
0
def exactWater0(test):
    test.test = lambda: assertlib.numberOnLine(
        0, lib.getLine(lib.outputOf(_fileName, stdinArgs=[0]), 0))
    test.description = lambda: "0 minutes equals 0 water bottles"
Exemple #30
0
def exactChange41(test):
    test.test = lambda: assertlib.numberOnLine(
        4, lib.getLine(lib.outputOf(_fileName, [0.41]), 0))
    test.description = lambda: "0.41$ in change equals 4 coins"