I have not tried this, but it looks feasible. When plumbers must pressure-test the waste (sewer) pipes after making changes, the problem is sealing the lower part of the line that connects to the street sewer. The tool use for this is an inflatable rubber "sausage" with a chain firmly attached to the end for pulling the deflated wiener-shaped balloon back out of the pipe after the test is over. This tool is very firm, strong rubber or suitable substitute (neoprene?) with thick walls and it is usually black. The tool comes in various inflated outside diameters to fit in various inside diameter sewer pipes.
The test is conducted using a vent pipe at least ten feet high, or by temporarily attaching a 10 foot high vertical pipe and filling it with water to establish a 10 foot pressure head, so the tool must be able to maintain its seal under that pressure, increased by a safety factor.
The 2" outside diameter sausage should suit some people. I would be afraid to use the 3", 4" or larger sizes, but they are available.
Two types are on Amazon, a 4" diameter long, sausage-shaped tube and a short "ball" available in 2", 3" and 4" diameters.
See on Amazon:
Oatey Oatey Cherne 271047 Long Test-Ball 4-inch Plug (looks to be over a foot long)
Cherne 270032 Test-Ball 3-Inch Plug (also available in 2" and 4" diameters) (much shorter, a few inches long?)
Cherne 270016 Test-Ball 1-1/4-Inch to 1-1/2-Inch Plug (much shorter, a few inches long?)