def test_key_info_from_material_description(
    material_description, description_key, default_algorithm, default_key_length, expected_kwargs
):
    expected_keyinfo = KeyInfo(**expected_kwargs)
    actual_keyinfo = KeyInfo.from_material_description(
        material_description, description_key, default_algorithm, default_key_length
    )

    assert actual_keyinfo == expected_keyinfo
def test_key_info_attrs_fail(invalid_kwargs):
    with pytest.raises(TypeError):
        kwargs = _VALID_KEY_INFO_KWARGS.copy()
        kwargs.update(invalid_kwargs)
        KeyInfo(**kwargs)