Exemple #1
0
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)
Exemple #2
0
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
Exemple #3
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)
Exemple #4
0
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)
Exemple #5
0
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)