Exemple #1
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])
Exemple #2
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
Exemple #3
0
 def test_extract_boolean_value(self):
     log = parse_xml_log(os.path.join(logs, "boolean_log.xml"))
     eis = log.find("EventInfo")
     for ei in eis:
         assert isinstance(ei.time_event_info,
                           bool), "Expected ei.time_event_info to be bool"