Great question. For what it's worth, I contribute to MXUnit (wrote the eclipse plugin), and this script appeared in a presentation I made at cfobjective this year, while writing simpler code ( http://mxunit.org/doc/zip /marc_esher_cfobjective_2009_designing_for_easy_testability.zip ).
In this case, I suggest NOT testing the download. I believe that we should not waste time testing, not our code. The likelihood that we will catch a mistake or other strangeness is low enough for me to justify its unverified. I believe that we should test "our" code.
In your scenario, you have two behaviors: 1) loading and 2) post-loading behavior. I would test the behavior after loading.
Now this frees up your unit test so as not to care about the source of the file. Notice how this actually leads to untying the loading logic from "what should I do with the file?" logics. To summarize, this at least creates the potential (theoretically) for reusing this logic after loading for other things besides just downloading.
This simplifies your test because now you can just test the file you put somewhere in the setUp of the unit test itself.
So your component changes from
<cfffunction name="uploadAndDoStuff">
to
<cffunction name="upload">
and then
<cffunction name="handleUpload">
or "handleFile" or "doSomethingWithFile" or "processNetworkFile" or something else. and in your unit test you leave upload () unchecked and just check your post-upload handler. For example, if I did this at work, and my requirements were: "Upload a file, move the file to the queue for virus scanning, create thumbnails if the image or jpg; add material to the database, etc.", then I would I saved each of these steps as separate functions, and I tested them in isolation, because I know that “upload file” already works, since it worked with CF1.0 (or something else). It makes sense?
Even better, leave the “unloading” of the component completely. There is nothing wrong with keeping it in a CFM file, because in an attempt to generalize it there is not so much (as far as I see). there may be benefits when taunted, but that's a completely different topic.