Esempio n. 1
0
    def testHTMLGeneration(self):
        # Note to self! Check the date if this function fails. HTML Generate puts today's date on all new html files.
        currentDir = os.getcwd()
        testingDocDir = os.path.join(currentDir, "TestingDocs")
        shutil.copyfile(testingDocDir + "\\tableGenerator.html", currentDir + "\\Test.html")

        event = Penalty(
            "Claude McSlash", "Boston Bruins", "Slashing", True, "Calgary Flames", "July 10, 2015", ["Don", "Ron"]
        )
        generateHTML(event.printTable(), "Test.html")
        self.assertTrue(filecmp.cmp("Test.html", testingDocDir + "\\CorrectTestTable.html"))
        os.remove("Test.html")