def test_setting_nofile_limit_os_fail(self, mock_setrlimit, *unused_mocks): """Assert that setting a rlimit greater than allow is handled well.""" mock_setrlimit.side_effect = resource.error('No files for you') hub_command = HubCommand() hub_command.log = mock.Mock() hub_command.set_rlimit_nofiles(limit=1844674407370) hub_command.log.warning.assert_called_once()