def METHOD_NAME(expect_filename, expect_bucket, expect_key,
                     expect_extra_args=None, expect_config=None):
    """Make a mock upload function that asserts against expected arguments and
    calls the Callback with the upload file size."""
    def mock_upload_file(Filename=None, Bucket=None, Key=None, Callback=None,
                         ExtraArgs=None, Config=None):
        assert Filename == expect_filename
        assert Bucket == expect_bucket
        assert expect_key == Key
        assert expect_extra_args == ExtraArgs
        if expect_config or Config:
            for key, val in expect_config.items():
                assert getattr(Config, key) == val
        Callback(os.path.getsize(Filename))
    return mock_upload_file