Example #1
0
 def test_extract_log_exception(self):
     try:
         extract_xml_log("Tmp2",
                         os.path.join(logs, "CoupledClutches_log_.txt"),
                         modulename='Model')
     except FileNotFoundError:
         pass
Example #2
0
    def test_extract_log_cs(self):
        extract_xml_log("Tmp3.xml",
                        os.path.join(logs, "CoupledClutches_CS_log.txt"),
                        modulename='Slave')

        assert os.path.exists("Tmp3.xml")

        log = parse_xml_log("Tmp3.xml")

        assert "<JMIRuntime node with 3 subnodes, and named subnodes ['build_date', 'build_time']>" == str(
            log.nodes[1]), "Got: " + str(log.nodes[1])
Example #3
0
    def test_extract_log_wrong_modulename(self):
        extract_xml_log("Tmp4.xml",
                        os.path.join(logs, "CoupledClutches_CS_log.txt"),
                        modulename='Test')

        assert os.path.exists("Tmp4.xml")

        log = parse_xml_log("Tmp4.xml")

        try:
            log.nodes[1]
        except IndexError:  #Test that the log is empty
            pass