I heard a story from an old oilman to the effect that in the very olden days they actually ran a real live pig (or piglet, depending on size of pipeline) down the pipe to test for obstructions. The pipeline was too narrow for the pig to turn around, and so it could go in only one direction. If the pig got stuck, then you could hear exactly where the problem was and bring the steam shovel to the appropriate location.

True story? I don't know. Does anybody know?

I don't know if that is true but some years ago New Scientist had a small news item about a new instrumented pig that was going to be used in the North Sea and the resident cartoonist decided to illustrate the item with a cartoon showing the four legged sort of pig being put in a pipeline. The magazine was inundated by animal lovers protesting at such cruelty.
No idea.  But I have seen formerly-live chickens that were found in the pig trap.  There were some known malcontents who had motive and opportunity.  Also, wildlife will creep into the open ends of pipelines under construction.  Good work practice is to cap off the ends at the end of the day, but we all know that every best practice is always followed, eh?
Mark Twain story.
The Romans had lead pipelines that carried aquaduct water under pressure down and up a valley to save on building one of those masonry aquaduct bridge things. Pigs might go back farther than you think...