Skip to content

Commit

Permalink
Correct tests after server timeout correction
Browse files Browse the repository at this point in the history
  • Loading branch information
Safihre committed Nov 3, 2022
1 parent 557b9ef commit 8597784
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions interfaces/wizard/one.html
Expand Up @@ -15,6 +15,8 @@ <h3>$T('wizard-server')</h3>

<br /><br />

<input type="hidden" name="server" value="$server" />

<div class="row">
<div class="col-md-7 form-horizontal">
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion sabnzbd/downloader.py
Expand Up @@ -152,7 +152,7 @@ def __init__(
self.article_queue: List[sabnzbd.nzbstuff.Article] = []

# Skip during server testing
if not threads:
if threads:
# Initialize threads
for i in range(threads):
self.idle_threads.append(NewsWrapper(self, i + 1))
Expand Down
2 changes: 2 additions & 0 deletions sabnzbd/interface.py
Expand Up @@ -513,6 +513,7 @@ def one(self, **kwargs):
# Just in case, add server
servers = config.get_servers()
if not servers:
info["server"] = ""
info["host"] = ""
info["port"] = ""
info["username"] = ""
Expand All @@ -530,6 +531,7 @@ def one(self, **kwargs):
for server in server_names:
# If there are multiple servers, just use the first enabled one
s = servers[server]
info["server"] = server
info["host"] = s.host()
info["port"] = s.port()
info["username"] = s.username()
Expand Down
2 changes: 1 addition & 1 deletion sabnzbd/utils/servertests.py
Expand Up @@ -40,7 +40,7 @@ def test_nntp_server_dict(kwargs):
timeout = int_conv(kwargs.get("timeout", DEF_TIMEOUT))
ssl = int_conv(kwargs.get("ssl", 0))
ssl_verify = int_conv(kwargs.get("ssl_verify", 1))
ssl_ciphers = kwargs.get("ssl_ciphers").strip()
ssl_ciphers = kwargs.get("ssl_ciphers", "").strip()

if not host:
return False, T("The hostname is not set.")
Expand Down
1 change: 1 addition & 0 deletions tests/test_newswrapper.py
Expand Up @@ -109,6 +109,7 @@ def test_newswrapper(
nw.server.host = TEST_HOST
nw.server.port = TEST_PORT
nw.server.info = socket.getaddrinfo(TEST_HOST, TEST_PORT, 0, socket.SOCK_STREAM)
nw.server.timeout = 10
nw.server.ssl = True
nw.server.ssl_context = None
nw.server.ssl_verify = 0
Expand Down

0 comments on commit 8597784

Please sign in to comment.