348 Commits

Author SHA1 Message Date
bendikro
37baf3de3c [#2875][Web] Fix: WebUI Json dumps Error 2016-10-19 10:47:41 +02:00
bendikro
cfdddc4469 [Web][Tests] Refactor web tests 2016-10-19 10:47:37 +02:00
bendikro
d505ebe926 [Tests] Use common.rpath() in all tests 2016-10-18 21:26:36 +01:00
bendikro
c8a3fd72d4 [Tests] Improve UI entry script tests
* Added parameter log.setup_logger to prevent output noise in unit tests
2016-10-18 21:26:22 +01:00
Calum Lind
9788ca08ea [GTKUI] Autofill infohash entry from clipboard
* Create new common.is_infohash func and test.
2016-10-18 19:22:59 +01:00
Calum Lind
9dd3b1617d [#2889] Fixes for 'Too many files open' error
* Ensure all file descriptors are closed. Using the with statement ensures
   closure.
 * The main problem was with thousands of unclosed file desciptors from
   tracker_icons mkstemp.
 * Use a prefix 'deluge_ticon.' to identify created tracker_icon tmp files.
2016-10-18 18:40:25 +01:00
bendikro
4751b33d0c [Console] Fix to console argument parsing
When starting console with './deluge-console', providing
loggin level '-L info' would fail to parse as it identified
'info' as a subcommand.
2016-05-24 23:59:22 +01:00
bendikro
a81f17a802 [Tests] Improve test docs 2016-05-24 23:53:14 +01:00
bendikro
94a9f17838 [Tests] Improve test docs 2016-05-24 21:10:53 +02:00
bendikro
5ca7bb365e [Tests] Use tests/common.todo_test to mark tests for TODO 2016-05-24 21:10:52 +02:00
bendikro
260268f62b [Tests] Inherit from BaseTestCase in testcases
* Testcases in test_torrent.py and test_torrentmanager.py creates
  components and should therefore inherit from BaseTestCase.
* Cleanup in test_json_api.py
2016-05-24 21:10:52 +02:00
bendikro
a8dac9bd3a [Base] [Tests] Add more component tests 2016-05-24 21:10:52 +02:00
bendikro
14b576e411 [Core] Fix core.remove_torrents return value on error 2016-05-24 21:10:52 +02:00
bendikro
152eaa10dd [Console] Fix bug when parsing UI commands
Command line arguments like "-L info" were incorrectly
identified as console subcommands which caused parsing
to fail.
2016-05-22 02:57:40 +02:00
bendikro
d689ad72e8 [UI] [#1973] Improve passing extra args to UIs
Current solution for passing arguments to UI when invoking deluge
entry script is to select an UI with the --ui option and supply quoted
arguments with the --args option.

This patch cleans this up by removing both options and change to using
subparsers for valid UIs. All command line options are now parsed
directly by the child UI which is chosen by a positional argument,
i.e. the UI name.

The help text now also shows the current default UI.
2016-05-21 15:05:01 +01:00
bendikro
fd9e68e7e7 [Tests] Place logfiles from py.test run in _pytest_temp 2016-05-19 22:20:28 +01:00
Calum Lind
fa309d0d18 [WebUI] Refactor json_api._get_host 2016-05-16 12:37:07 +01:00
bendikro
1fb9960168 [Base] Updated fix for missing trace with new twisted logger
Includes a commented out test to replicate the issue.
2016-05-09 13:57:54 +01:00
bendikro
bb0e699619 [UI] Add tests for ui_entry 2016-05-08 12:00:44 +01:00
Calum Lind
d5294d5733 [Tests] Fix json_api AlreadyCancelled watchdog error 2016-05-08 10:36:44 +01:00
bendikro
9be1bd523a [Tests] Cancel watchdog deferreds on test completion 2016-05-06 12:44:45 +01:00
bendikro
857e2fd46e [#1959] [WebUI] Allow user selectable GUI language 2016-04-25 13:26:58 +01:00
bendikro
70d8b65f0a [WebUi] [Core] Fixes to plugin handling and WebUi plugin + tests
This should fix problems with errors occuring when failing to
enable plugins. Errors in plugin handling are handled better
and properly logged.

WebUI plugin in particular had issues when being enabled and disabled
multiple times because it was trying to create DelugeWeb component
each time it was enabled. If deluge-web is already listening on
the same port, enabling the WebUI plugin will fail, and the checkbox
will not be checked.

There are still some issues when enabling/disabling plugins by
clicking fast multiple times on the checkbox.
2016-04-18 15:49:30 +01:00
bendikro
5edb923904 [Base] Split main.py into ui/ui_entry.py and core/daemon_entry.py 2016-04-18 09:36:20 +02:00
bendikro
6300f9154a [#1949] [UI] Allow setting max size for rotating log file 2016-04-18 09:36:13 +02:00
Calum Lind
6287a782a1 [Lint] Fix Redundant use of assertFalse with constant value True 2016-04-16 18:24:20 +01:00
Calum Lind
e468436b0c [Lint] Update pylintrc and fixup code for newly introduced messages
* pylintrc is now compatible with pylint 1.6.
 * Add to ignore wrong-import-position and wrong-import-order as
   we use isort and pylint is raising too many incorrect messages.
2016-04-12 14:12:21 +01:00
bendikro
887afa9389 [GTKUI] Fix bugs in files_tab and added tests
After renaming files/directories in GTKUI, the file list wasn't
properly updated, requiring to choose another torrent to get
a file list update.
2016-04-11 11:56:34 +01:00
bendikro
712b2715d4 [Tests] Fix to json tests 2016-04-11 01:36:49 +02:00
bendikro
d8c4d8c1aa [Core] Fix to async_add_torrent commmit (5d1aff15) 2016-04-11 00:43:58 +02:00
bendikro
5d1aff157e [Core] Implement async_add_torrent in torrentmanager 2016-04-10 11:46:22 +01:00
Calum Lind
73220b5116 [Lint] Fix issues picked up by scrutinizer 2016-04-10 10:58:57 +01:00
bendikro
d58960d723 [Tests] [Web] Make JSON independent of Web component
* Implement JSONTestCase in test_json_api.py
* Implement WebAPITestCase test case in test_web_api.py
2016-04-10 00:10:53 +02:00
bendikro
bcc1db12e5 [Tests] Improved common.start_core
* Replace Popen with reactor.spawnProcess and read process
  output with twisted.internet.protocol.ProcessProtocol
* Implement support for running custom script code
* Now logs to stdout instead of stderr when not logging to file
2016-04-10 00:10:48 +02:00
bendikro
9b18fb2b71 [Tests] Fix failing SessionProxy tests
For some reason, the time.sleep calls in the tests in
test_sessionproxy did not sleep for the expected amount
of time causing the results to differ from the expected.
Fixed by replacing time.time function with twisted's
task.clock.seconds and advancing the clock manually.

Also minor changes to test_client.py
2016-04-09 22:19:44 +02:00
bendikro
cae8a18437 [Tests] Fixes to improve terminal output from unit tests
Add __str__ to WrappedException so that the stacktrace is printed when a
unit test raises a WrappedException.

Change the log output from error to warning in DelugeRPCProtocol.dispatch
when sending back a raised exception on an RPC request.
2016-04-08 16:35:09 +02:00
bendikro
374989a2ad [Tests] Catch and print errors in setup/teardown 2016-04-08 16:35:09 +02:00
bendikro
fc6672adda Fix #2789: Test for google tracker icon redirect is failing 2016-04-07 22:11:25 +01:00
Calum Lind
815f67467a [Tests] Update ubuntu icon, skip google & openbt icon tests 2016-04-07 09:52:33 +01:00
Andrew Resch
d91e5d894f Add command-line option for the daemon to restrict some config keys to being read-only.
This only affects the core.set_config() RPC method which will drop items if the key
is listed as read-only.
2016-02-02 19:25:46 -08:00
bendikro
a987c3ed39 [Core] Raise AttributeError on RPC call to invalid function
Also catch and log errors in rcpserver.sendData
2015-12-14 12:08:18 +00:00
Calum Lind
382a99ad61 [GTKUI] Cleanup code duplication in Tabs 2015-12-12 22:10:53 +00:00
Calum Lind
080d137af8 [Tests] Move test_torrent_error code into test_torrent 2015-12-12 14:29:07 +00:00
bendikro
02f6bfd578 [#1260] Handle redirection better with httpdownloader 2015-12-11 22:48:36 +00:00
Calum Lind
cde17925fc [Lint] Autopep8 aggressive run
* Uses isinstance() instead of type()
 * Uses sorted() where possible
2015-11-04 11:54:15 +00:00
Calum Lind
807fa609f9 [Lint] Cleanup code to pass PyLint Warning category
Selected Warning messages disabled in pylintrc:
  * unused-argument: Quite a large and disruptive change if enabled.
  * broad-except: Most required in-depth investigation to determine type.
  * fixme: Not important
  * protected-access: Complicated to fix
  * import-error: Too many false-positives
  * unidiomatic-typecheck: Should be fixed in the next round of checks.
  * unused-variable: Again large and disruptive changes.
  * global-statement: Most usage is required.
  * attribute-defined-outside-init: Should be fixed in next round of checks.
  * arguments-differ: Possible false-positives, needs revisited.
  * no-init, non-parent-init-called, super-init-not-called: False-positives?
  * signature-differs: False-positives?
2015-10-30 18:39:47 +00:00
Calum Lind
ad3cba929e [Lint] Cleanup code to pass PyLint Convention category
Disabled Conventions messages:
   * missing-docstring: Not likely all methods/funcs will ever have docstrings.
   * invalid-name: Far too many too fix so will simply have to ensure submitted
     or altered code keeps to the convention.
   * old-style-class: Not a priority but would be nice to eventually fix this.
   * bad-continuation: Occasionally conflicts with pep8, not worth enabling if using
     pyflakes and pep8 as these will catch most continuation issues.
2015-10-30 18:39:42 +00:00
Calum Lind
6eb46c935e [Lint] Add PyLint support and cleanup code with basic changes
* Include a pylintrc config file
 * This commit provides a basic error-only pylint config as a starting
   point with a view to adding more checks incrementally to keep the volume
   of changes low and the code able to pass pylint at each stage.
2015-10-30 18:38:56 +00:00
Calum Lind
4ae43c5f2a [#1032] Error out torrent if data is missing on startup 2015-10-30 15:28:20 +00:00
Calum Lind
32bc20d8ce Fix pep8 across codebase
* Further whitespace fixes by autopep8
 * Using pep8 v1.6.2 (not currently used by pyflakes)
 * Update config for pep8 and flake8 in tox.ini
   * A separate pep8 entry for running autopep8. The ignores prevent
     blank lines being added after docstrings.
   * .tox and E133 are ignored in flake8 by default.
2015-10-21 00:06:27 +01:00