def test_kernel_set_id_for_str(cassini_kernel_set):
    '''Test kernel set search for id and error cases.'''
    kernel_set_id = int(cassini_kernel_set['kernelSetId'])
    kernel_set_caption = cassini_kernel_set['caption']

    assert API.kernel_set_id(kernel_set_caption) == kernel_set_id

    kernel_set = API.kernel_set(kernel_set_caption)
    assert API.kernel_set_id(kernel_set) == kernel_set_id

    with pytest.raises(TypeError):
        API.kernel_set_id(1.23)
def test_kernel_set_not_found():
    '''Test error if kernel set not found.'''
    with pytest.raises(KernelSetNotFound):
        assert str(API.kernel_set('Missing kernel'))
def test_kernel_set_too_many_found():
    '''Test error if too many kernel sets are found.'''
    with pytest.raises(TooManyKernelSets):
        assert str(API.kernel_set('Cassini'))
def test_kernel_set_by_name_partial():
    '''Test partial kernel set search.'''
    assert str(API.kernel_set('Solar')) == 'Solar System Kernels'
def test_kernel_set_by_name_not_case_sensitive():
    '''Test case sensitivity of kernel set search.'''
    assert str(
        API.kernel_set('solar system kernels')) == 'Solar System Kernels'
def test_kernel_set_by_full_name():
    '''Test kernel set name.'''
    assert str(
        API.kernel_set('Solar System Kernels')) == 'Solar System Kernels'
def test_kernel_set_by_id():
    '''Test kernel set id.'''
    assert int(API.kernel_set(1)) == 1