Exemplo n.º 1
0
	def testMethod():
		if helpers.isHardcodedIn(1942, test.fileName):
			test.success = lambda info : "watch out: 1942 appears to be hardcoded!"

		output = lib.outputOf(
			test.fileName,
			overwriteAttributes = [("__name__", "__main__")]
		)
		line = helpers.findLineWith(output, "-24.8")

		correctDay = assertlib.contains(line, '27')
		correctMonth = any([assertlib.contains(line.lower(), month) for month in ["1", "januari", "january", "jan"]])
		correctYear = assertlib.contains(line, '1942')
		return correctDay and correctMonth and correctYear
Exemplo n.º 2
0
    def testMethod():
        if helpers.isHardcodedIn(1947, test.fileName):
            test.success = lambda info: "watch out: 1947 appears to be hardcoded!"

        output = lib.outputOf(test.fileName,
                              overwriteAttributes=[("__name__", "__main__")])
        line = helpers.findLineWith(output, "21")

        correctDay = assertlib.contains(line, '24')
        correctMonth = any([
            assertlib.contains(line.lower(), month)
            for month in ["februari", "february", "feb"]
        ])
        correctYear = assertlib.contains(line, '1947')
        return correctDay and correctMonth and correctYear, "Did you print the date on the same line as the longest period of frost?"
Exemplo n.º 3
0
    def testMethod():
        if helpers.isHardcodedIn(1947, test.fileName):
            test.success = lambda info: "let op: deze output is hardcoded. 1947 staat in de source code!"

        output = lib.outputOf(test.fileName,
                              overwriteAttributes=[("__name__", "__main__")])
        line = helpers.findLineWith(output, "36.8")

        correctDay = assertlib.contains(line, '27')
        correctMonth = any([
            assertlib.contains(line.lower(), month)
            for month in ["6", "juni", "june", "jun"]
        ])
        correctYear = assertlib.contains(line, '1947')
        return correctDay and correctMonth and correctYear