Sewer lines don't have valves, so they have to be plugged. Some people just cram towels or something like that in the lines.
In some cases, one could open a clean out (threaded plug) usually located on a T-fitting. My septic line goes through the basement across the ceiling, through an L, drops through a short section to a T with a cleanout. I could remove the plug and insert a long plug to seal it if necessary.
If one does not have a clean out on the main line, then one has to diconnect drainlines to sinks and plug them. Toilets, bathtubs and showers have to be plugged because there is usually no access to the drainline.
I used to do work in commercial plumbing - and I think the plumbing in most houses is poorly designed because of the limited access. Commerical plumbing usually had access panels and pipe chases so that supply and DWV could be accessed.