metrics.test package

Submodules

metrics.test.test_daily_metrics module

class metrics.test.test_daily_metrics.TestDailyMetricsProcessor(methodName='runTest')

Bases: django.test.testcases.TransactionTestCase

Tests the DailyMetricsProcessor clock event class.

setUp()
test_process_event_duplicate(*args, **keywargs)

Tests processing an event that was previously handled.

test_process_event_first(*args, **keywargs)

Tests processing an event that was never triggered before.

test_process_event_last(*args, **keywargs)

Tests processing an event that was triggered before.

test_process_event_range(*args, **keywargs)

Tests processing an event that requires catching up for a range of previous days.

metrics.test.test_models module

class metrics.test.test_models.TestMetricsError(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests the MetricsError model logic.

setUp()
test_calculate_filtered()

Tests generating metrics with only certain errors.

test_calculate_none()

Tests generating metrics when there are no matching errors.

test_calculate_repeated()

Tests regenerating metrics for a date that already has metrics.

test_calculate_stats()

Tests calculating individual statistics for a metrics entry.

test_get_metrics_type()

Tests getting the metrics type.

test_get_metrics_type_choices()

Tests getting the metrics type with choices.

test_get_plot_data()

Tests getting the metrics plot data.

test_get_plot_data_filtered()

Tests getting the metrics plot data with filters.

class metrics.test.test_models.TestMetricsIngest(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests the MetricsIngest model logic.

fixtures = ['ingest_job_types.json']
setUp()
test_calculate_filtered()

Tests generating metrics with only certain ingests.

test_calculate_none()

Tests generating metrics when there are no matching executions.

test_calculate_repeated()

Tests regenerating metrics for a date that already has metrics.

test_calculate_stats()

Tests calculating individual statistics for a metrics entry.

test_calculate_stats_partial()

Tests individual statistics are null when information is unavailable.

test_calculate_strike_is_none()

Tests generating metrics for a date that has ingests with None in Strike field (Scan parent ingest).

test_get_metrics_type()

Tests getting the metrics type.

test_get_metrics_type_choices()

Tests getting the metrics type with choices.

test_get_plot_data()

Tests getting the metrics plot data.

test_get_plot_data_filtered()

Tests getting the metrics plot data with filters.

class metrics.test.test_models.TestMetricsJobType(methodName='runTest')

Bases: django.test.testcases.TestCase

Tests the MetricsJobType model logic.

setUp()
test_calculate_filtered()

Tests generating metrics with only certain job executions.

test_calculate_negative_times()

Tests calculating times when machine clocks are out of sync.

test_calculate_none()

Tests generating metrics when there are no matching executions.

test_calculate_range()

Tests generating metrics for a specific date range

test_calculate_repeated()

Tests regenerating metrics for a date that already has metrics.

test_calculate_stats()

Tests calculating individual statistics for a metrics entry.

test_calculate_stats_partial()

Tests individual statistics are null when information is unavailable.

test_get_metrics_type()

Tests getting the metrics type.

test_get_metrics_type_choices()

Tests getting the metrics type with choices.

test_get_plot_data()

Tests getting the metrics plot data.

test_get_plot_data_filtered()

Tests getting the metrics plot data with filters.

metrics.test.test_views module

class metrics.test.test_views.TestMetricDetailsViewV6(methodName='runTest')

Bases: rest_framework.test.APITransactionTestCase

setUp()
test_successful()

Tests successfully calling the metric details view.

class metrics.test.test_views.TestMetricPlotViewV6(methodName='runTest')

Bases: rest_framework.test.APITransactionTestCase

setUp()
test_aggregate_avg()

Tests successfully calling the metric plot view using an average aggregate.

test_aggregate_max()

Tests successfully calling the metric plot view using a maximum aggregate.

test_aggregate_min()

Tests successfully calling the metric plot view using a minimum aggregate.

test_aggregate_sum()

Tests successfully calling the metric plot view using a sum aggregate.

test_by_hour()

Tests successfully binning the metric plot view by hour.

test_choices()

Tests successfully calling the metric plot view with choice filters.

test_columns()

Tests successfully calling the metric plot view with column filters.

test_completed_failed()

Tests the metrics plot view completed and failed

test_groups()

Tests successfully calling the metric plot view with group filters.

test_single_choice()

Tests successfully calling the metric plot view with a single choice filter.

test_successful()

Tests successfully calling the metric plot view.

class metrics.test.test_views.TestMetricsViewV6(methodName='runTest')

Bases: rest_framework.test.APITestCase

setUp()
test_successful()

Tests successfully calling the metrics view.

metrics.test.utils module

Defines utility methods for testing metrics

metrics.test.utils.create_error(error=None, occurred=None, **kwargs)

Creates a metrics ingest model for unit testing

Returns:The metrics ingest model
Return type:metrics.models.MetricsIngest
metrics.test.utils.create_ingest(strike=None, occurred=None, **kwargs)

Creates a metrics ingest model for unit testing

Returns:The metrics ingest model
Return type:metrics.models.MetricsIngest
metrics.test.utils.create_job_type(job_type=None, occurred=None, **kwargs)

Creates a metrics job type model for unit testing

Returns:The metrics job type model
Return type:metrics.models.MetricsJobType

Module contents