def test_random_color_c_errors():
    '\n    Test that Cpp RandomColor errors with bad input\n    '
    with pytest.raises(TypeError) as error_info:
        vision.RandomColor(12)
    assert ('degrees must be either a tuple or a list.' in str(error_info.value))
    with pytest.raises(TypeError) as error_info:
        vision.RandomColor(('col', 3))
    assert ("Argument degrees[0] with value col is not of type (<class 'int'>, <class 'float'>)." in str(error_info.value))
    with pytest.raises(ValueError) as error_info:
        vision.RandomColor((0.9, 0.1))
    assert ('degrees should be in (min,max) format. Got (max,min).' in str(error_info.value))
    with pytest.raises(ValueError) as error_info:
        vision.RandomColor((0.9,))
    assert ('degrees must be a sequence with length 2.' in str(error_info.value))
    mnist_ds = ds.MnistDataset(dataset_dir=MNIST_DATA_DIR, num_samples=2, shuffle=False)
    mnist_ds = mnist_ds.map(operations=vision.RandomColor(), input_columns='image')
    with pytest.raises(RuntimeError) as error_info:
        for _ in enumerate(mnist_ds):
            pass
    assert ('image shape is not <H,W,C> or channel is not 3' in str(error_info.value))
Test that Cpp RandomColor errors with bad input
def test_random_color_c_errors():
    '\n    \n    '
    with pytest.raises(TypeError) as error_info:
        vision.RandomColor(12)
    assert ('degrees must be either a tuple or a list.' in str(error_info.value))
    with pytest.raises(TypeError) as error_info:
        vision.RandomColor(('col', 3))
    assert ("Argument degrees[0] with value col is not of type (<class 'int'>, <class 'float'>)." in str(error_info.value))
    with pytest.raises(ValueError) as error_info:
        vision.RandomColor((0.9, 0.1))
    assert ('degrees should be in (min,max) format. Got (max,min).' in str(error_info.value))
    with pytest.raises(ValueError) as error_info:
        vision.RandomColor((0.9,))
    assert ('degrees must be a sequence with length 2.' in str(error_info.value))
    mnist_ds = ds.MnistDataset(dataset_dir=MNIST_DATA_DIR, num_samples=2, shuffle=False)
    mnist_ds = mnist_ds.map(operations=vision.RandomColor(), input_columns='image')
    with pytest.raises(RuntimeError) as error_info:
        for _ in enumerate(mnist_ds):
            pass
    assert ('image shape is not <H,W,C> or channel is not 3' in str(error_info.value))