pytest tests.model.random_data

class tests.model.random_data.BiometricsRandomData(seed: Optional[int] = None)

Bases: RandomData

A subclass of tests.RandomData the provides random values particular to the biometrics_tracking package

random_dob() date

Provides a random date in the range 1/1/1940 to 12/31/1970

Returns

a random date

Return type

datetime.date

random_dom(month: int, max_dom: int) list[int]

Returns a randomly chosen list of days of the month

Parameters
  • month (int) – the month to be used as an upper boundary for values to be returned

  • max_dom (int) – the maximum number of days to be returned

Returns

a list of days of the month

Return type

list[int]

random_dp_type() DataPointType

Returns a random DataPointType enum value

Returns

random DataPointType

Return type

biometrics_tracker.model.datapoints.DataPointType

random_frequency_type() FrequencyType

Returns a random FrequencyType for a ScheduleEntry

Returns

random FrequencyType

Return type

biometrics_tracker.model.datapoints.FrequencyType

random_uom(dp_type: DataPointType) UOM

Returns a random UOM enum value appropriate to the provided DataPointType

Parameters

dp_type (biometrics_tracking.model.datapoints.DataPointType) – the DataPointType to be used in determining which UOM enum class is to be used

Returns

a random UOM enum value

Return type

a subclass of biometrics_tracking.model.datapoints.UOM value

random_weekdays(max_days) list[biometrics_tracker.model.datapoints.WeekDay]

A list of randomly chosen Weekday enum values.

Parameters

max_days (int) – the maximum number of Weekday enum values to be returned

Returns

a list of Weekday enum values

Return type

list[biometrics_tracker.model.datapoints.Weekday]