def test_get_colorized_contents_calls_methods(patched_colorizer_class):
    """
    We should call the correct methods on the EgColorizer objects when we color
    a file.
    """
    raw_contents = 'these are uncolored contents'
    colored_contents = 'COLORED: ' + raw_contents
    color_config = 'some color config'

    # The actual instance created by these calls is stored at return_value.
    colorizer_instance = patched_colorizer_class.return_value
    colorizer_instance.colorize_text.return_value = colored_contents

    actual = util.get_colorized_contents(raw_contents, color_config)

    assert actual == colored_contents
    colorizer_instance.colorize_text.assert_called_once_with(raw_contents)

    We should call the correct methods on the EgColorizer objects when we color
    a file.
    
test/util_test.py