def METHOD_NAME(self):
    self.session_mock.side_effect = Exception("Connection error.")
    with self.assertRaisesRegex(ResourceLoadingError, 'foo\.bar\.baz'):
        self.get_paramfile('https://foo.bar.baz')