def generate_incarceration_incident( person, **kwargs) -> schema.StateIncarcerationIncident: args = { "state_code": _STATE_CODE, } args.update(kwargs) return schema.StateIncarcerationIncident(person=person, **args)
def generate_test_incarceration_incident(person_id, incarceration_incident_outcomes) -> \ state_schema.StateIncarcerationIncident: instance = state_schema.StateIncarcerationIncident( incarceration_incident_id=321, state_code='us_ca', person_id=person_id, incarceration_incident_outcomes=incarceration_incident_outcomes) return instance
def test_getRootEntity(self) -> None: # Arrange incarceration_incident = schema.StateIncarcerationIncident( external_id=_EXTERNAL_ID) placeholder_incarceration_period = schema.StateIncarcerationPeriod( incarceration_incidents=[incarceration_incident]) placeholder_incarceration_sentence = schema.StateIncarcerationSentence( incarceration_periods=[placeholder_incarceration_period]) placeholder_sentence_group = schema.StateSentenceGroup( sentence_group_id=None, incarceration_sentences=[placeholder_incarceration_sentence], ) person = schema.StatePerson( sentence_groups=[placeholder_sentence_group]) # Act root_entity_cls = get_root_entity_cls([person]) # Assert self.assertEqual(schema.StateIncarcerationIncident, root_entity_cls)