make the dummy url opener configurable

It can now return an arbitrary response, or raise an exception.
move creation of the opener into the actual tests, in order
to provide the response or exception