linpershey/process_mining
0
1import os2import unittest3 4from pm4py.objects.log.importer.xes import importer as xes_importer5from pm4py.objects.log.util import dataframe_utils6from pm4py.util import constants, pandas_utils7from pm4py.statistics.passed_time.log import algorithm as log_passed_time8from pm4py.statistics.passed_time.pandas import algorithm as df_passed_time9 10 11class PassedTimeTest(unittest.TestCase):12 def test_passedtime_prepost_log(self):13 log = xes_importer.apply(os.path.join("..", "tests", "input_data", "running-example.xes"))14 prepost = log_passed_time.apply(log, "decide", variant=log_passed_time.Variants.PREPOST)15 del prepost16 17 def test_passedtime_prepost_df(self):18 df = pandas_utils.read_csv(os.path.join("input_data", "running-example.csv"))19 df = dataframe_utils.convert_timestamp_columns_in_df(df, timest_format=constants.DEFAULT_TIMESTAMP_PARSE_FORMAT)20 prepost = df_passed_time.apply(df, "decide", variant=df_passed_time.Variants.PREPOST)21 del prepost22 23 24if __name__ == "__main__":25 unittest.main()26 