def test_adapter_validation_scheme(self): adapter_full_validation_scheme = Adapter.validation_scheme() assert isinstance(adapter_full_validation_scheme, dict) assert len(adapter_full_validation_scheme) == len(Adapter.providers) assert contains_all(adapter_full_validation_scheme, Adapter.providers) assert set(adapter_full_validation_scheme['classification']) == set( Adapter.validation_scheme('classification'))
def test_age_gender_adapter_raise_config_error_on_extra_args(): adapter_config = { 'type': 'age_gender', 'gender_out': 'gender', 'age_out': 'age', 'something_extra': 'extra' } with pytest.raises(ConfigError): Adapter.provide('age_gender', adapter_config)
def test_dictionary_adapter_no_raise_warning_on_specific_args(): adapter_config = { 'type': 'age_gender', 'gender_out': 'gender', 'age_out': 'age' } with pytest.warns(None) as record: Adapter.provide('age_gender', adapter_config) assert len(record) == 0
def test_vehicle_attributes_adapter_raise_config_error_on_extra_args(): adapter_config = { 'type': 'vehicle_attributes', 'color_out': 'color', 'type_out': 'type', 'something_extra': 'extra' } with pytest.raises(ConfigError): Adapter.provide('vehicle_attributes', adapter_config)
def test_face_person_detection_adapter_raise_config_error_on_extra_args(): adapter_config = { 'type': 'face_person_detection', 'face_detection_out': 'face', 'person_detection_out': 'person', 'something_extra': 'extra' } with pytest.raises(ConfigError): Adapter.provide('face_person_detection', adapter_config)
def test_head_pose_adapter_raise_config_error_on_extra_args(): adapter_config = { 'type': 'head_pose', 'angle_yaw': 'yaw', 'angle_pitch': 'pitch', 'angle_roll': 'roll', 'something_extra': 'extra' } with pytest.raises(ConfigError): Adapter.provide('head_pose', adapter_config)