test_utils module

Testing helper functions to store common pytest and xray publishing functionality.

aiv_utils.test_utils.grab_tagged_cell_text(pm_result, tag)

Grab the text of a papermill notebook cell with the input tag.

Params pm_result:

The output object of a papermill run

Params tag:

The tag the cell has been given

Return cell_string:

The output string of the tagged cell

Return type:

str

aiv_utils.test_utils.is_calendar_booked(calendar_uid, ignorable_event_type_ids, start_time, end_time)

Checks if calendar is booked within input time range.

Params calendar_uid:

UID of the calendar to check

Params event_type_ids:

List of event type ids to ignore

Params start_time:

datetime object of the start of the time range

Params end_time:

datetime object of the end of the time range

Returns:

True if calendar is booked and False if it isn’t

aiv_utils.test_utils.make_test_dir(dir_prefix='test', base_dir='build/test_runs')

Create a directory for the test runs of the notebooks to be output to.

Params dir_prefix:

The prefix of the test directory, default is test

Params base_dir:

The base directory that the test directory will be made in, the default is build/test_runs

Return type:

str