Skip to content

Commit

Permalink
remove useless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dnzbk committed Apr 16, 2024
1 parent 7998275 commit 27d554e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
8 changes: 1 addition & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Speed limit extension script for NZBGet.
#
# Copyright (C) 2021 Andrey Prygunkov <[email protected]>
# Copyright (C) 2024 Denis <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -30,13 +31,6 @@
SCRIPT_SUCCESS = 93
SCRIPT_ERROR = 94

# Check if the script is called from nzbget 24 or later
nzbget_version = float(os.environ.get("NZBOP_Version", "1")[0:4])
if nzbget_version < 24:
print("*** NZBGet extension script ***")
print("This script is supposed to be called from nzbget (24 or later).")
sys.exit(SCRIPT_ERROR)

# Check if all script options are available
required_options = ("NZBPO_Interval", "NZBPO_Interval")
for optname in required_options:
Expand Down
23 changes: 0 additions & 23 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def set_defaults_env():
os.environ["NZBOP_Version"] = "20"
os.environ["NZBPO_Verbose"] = "no"
os.environ["NZBPO_Interval"] = "5"
os.environ["NZBOP_Version"] = "24"
os.environ["NZBOP_DownloadRate"] = "15"


Expand All @@ -101,28 +100,6 @@ def test_command(self):
thread.join()
self.assertEqual(code, SUCCESS)

def test_nzbget_version(self):
set_defaults_env()
os.environ["NZBOP_Version"] = "22"
server = http.server.HTTPServer((HOST, int(PORT)), Request)
thread = threading.Thread(target=server.serve_forever)
thread.start()
[_, code, _] = run_script()
server.shutdown()
server.server_close()
thread.join()
self.assertEqual(code, ERROR)

os.environ["NZBOP_Version"] = "24"
server = http.server.HTTPServer((HOST, int(PORT)), Request)
thread = threading.Thread(target=server.serve_forever)
thread.start()
[_, code, _] = run_script()
server.shutdown()
server.server_close()
thread.join()
self.assertEqual(code, SUCCESS)

def test_manifest(self):
with open(ROOT_DIR + "/manifest.json", encoding="utf-8") as file:
try:
Expand Down

0 comments on commit 27d554e

Please sign in to comment.