def test_endpoint_url_set_but_not_for_s3(self): args = mock.Mock() args.endpoint_url = 'http://custom/' args.command = 'NOTS3' event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) self.assertFalse(event_handler.unregister.called)
def test_endpoint_url_set_but_not_for_s3(self): args = mock.Mock() args.endpoint_url = 'http://custom/' args.command = 'NOTS3' event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) self.assertFalse(event_handler.unregister.called)
def test_endpoint_url_unregisters_fix_s3_host(self): args = mock.Mock() args.endpoint_url = 'http://custom/' args.command = 's3' event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) event_handler.unregister.assert_called_with('before-sign.s3', fix_s3_host)
def test_endpoint_url_unregisters_fix_s3_host(self): args = mock.Mock() args.endpoint_url = 'http://custom/' args.command = 's3' event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) event_handler.unregister.assert_called_with('before-sign.s3', fix_s3_host)
def test_unregister_not_called_for_no_endpoint(self): args = mock.Mock() args.endpoint_url = None event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) self.assertFalse(event_handler.unregister.called)
def test_unregister_not_called_for_no_endpoint(self): args = mock.Mock() args.endpoint_url = None event_handler = mock.Mock() on_top_level_args_parsed(args, event_handler) self.assertFalse(event_handler.unregister.called)