def test_plot(test_data, tmp_path): """Ensure the plotting mechanism doesn't raise errors.""" assert _plot(_normalise(test_data), tmp_path) assert list(tmp_path.iterdir()) == [ Path(tmp_path, 'cylc.flow.main_loop.log_main_loop.pdf') ]
def test_normalise(test_data): """Ensure we correctly normalise the timings against the earliest time.""" assert _normalise(test_data) == { 'foo': [(1, 1), (2, 2), (3, 3)], 'baz': [(0, 4), (1, 5), (2, 6)], }
def test_dump(test_data, tmp_path): """Ensure the data is serialisable.""" assert _dump(_normalise(test_data), tmp_path) assert list(tmp_path.iterdir()) == [ Path(tmp_path, 'cylc.flow.main_loop.log_main_loop.json') ]
def test_normalise(test_data): """Ensure we correctly normalise the timings against the earliest time.""" assert _normalise(_transpose(test_data)) == { 'baz': ((3, ), ('d', )), 'foo': ((0, 1, 2), ('a', 'b', 'c')) }