def test_create_gantt_plotly(tmpdir): """test_create_gantt_plotly.""" team = Team("team") w1 = Worker("w1", cost_per_time=10.0) w1.state_record_list = [ BaseWorkerState.WORKING, BaseWorkerState.WORKING, BaseWorkerState.FREE, BaseWorkerState.WORKING, BaseWorkerState.FREE, BaseWorkerState.FREE, ] w2 = Worker("w2", cost_per_time=5.0) w2.state_record_list = [ BaseWorkerState.WORKING, BaseWorkerState.WORKING, BaseWorkerState.FREE, BaseWorkerState.WORKING, BaseWorkerState.FREE, BaseWorkerState.FREE, ] team.worker_list = [w1, w2] init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0) timedelta = datetime.timedelta(days=1) team.create_gantt_plotly(init_datetime, timedelta) # not yet implemented team.create_gantt_plotly(init_datetime, timedelta, save_fig_path=os.path.join( str(tmpdir), "test.png"))
def test_create_gantt_plotly(): team = Team("team") w1 = Worker("w1", cost_per_time=10.0) w1.start_time_list = [0, 5] w1.finish_time_list = [2, 8] w2 = Worker("w2", cost_per_time=5.0) w2.start_time_list = [9] w2.finish_time_list = [11] team.worker_list = [w1, w2] init_datetime = datetime.datetime(2020, 4, 1, 8, 0, 0) timedelta = datetime.timedelta(days=1) team.create_gantt_plotly(init_datetime, timedelta) # not yet implemented team.create_gantt_plotly(init_datetime, timedelta, save_fig_path="test.png")