Commit Graph
34 Commits
Author SHA1 Message Date
mnightingale ec6ba3baae Speed up tests with pytest-xdist (#3546)
* Speed up tests with pytest-xdist

* Ignore request failures when the server disappeared

* Fix tests which modify module globals

* Fix lang change leaking

* Fix transaction compilation order breaking tests

* Always load a clean config and fix related tests

* No module globals

* Fix other test classes assigning module level by making calls

* Replace from sabnzbd.cfg import so monkeypatch works

* More global poisoning

* Fix dependant tests which worksteal breaks

* More global vars

* Drop loadscope until more failures are resolved

* Due to how pytest-xdist is implemented, the -s/--capture=no option does not work

* monkeypatch db_path

* Also patch startup_done

* loadscope
2026-08-10 17:44:18 +01:00
Safihre 661b4ae535 Use native API for FAT filesystem detection on macOS
The previous method for detecting FAT filesystems on macOS relied on parsing `df` and `mount` command output, which is brittle and prone to issues with command output variations.

This change replaces the shell command parsing with a more robust and idiomatic approach using Foundation.framework's `NSURL` API. This directly queries the volume's localized format description, ensuring accurate identification of MS-DOS (FAT12/FAT16/FAT32) volumes while correctly distinguishing them from ExFAT.

Adds unit tests for the `isFAT` function to verify basic functionality and error handling.

Closes #3483
2026-07-10 10:28:08 +02:00
Safihre 0950393b82 Correctly format tests based on new rules and remove star imports 2026-06-05 14:34:17 +02:00
mnightingale 2184964d78 Reduce time to test (#3412)
* Remove UI delays

* Everything using set_config, set_platform, or pyfakefs

* tmp_path

* Scroll to top seems unnecessary but make it wait until it's done

* Remove sleep from test_rss_basic_flow

* Remove sleeps from test_daemonizing

* Define pytest markers

* Reduce sleep in test_queue_repair

* Remove sleeps from clean_cache_dir

* Suppress failures to connect during startup

* Reduce cache sleeps

* Reduce sleeps checking app started

* Reduce sleep removing cache dir
2026-05-13 18:49:41 +02:00
Safihre 2122503762 Update copyright to 2026 2026-02-09 16:44:38 +01:00
thezoggy dd0122865a bump copyright year (#3034) 2025-02-17 14:06:12 +01:00
jcfp fe88760600 switch test_cert_gen check to utc (#3003) 2024-12-21 22:52:20 +01:00
Safihre 9145a90e33 Update test_cert_gen for new cryptography default 2024-07-24 16:10:58 -06:00
thezoggy 9f6a9f9912 normalize and update copyright year 2024-01-02 09:42:17 +01:00
Safihre 3295142d81 Use sabctools for Internet Bandwidth measurement
Closes #2737
2023-12-06 13:44:12 +01:00
Safihre f9f3820652 Refactor the way we getaddrinfo and use Happy Eyeballs (#2713)
* Refactor the way we getaddrinfo and use  Happy Eyeballs

* Move tests to right directory

* Do not run Happy Eyeballs for only 1 address

* Process feedback

* Make sure we always have a canonname

* Show IP and resolved name in Status Window

* Simplify Status server updates

* Remove unused imports
2023-10-24 20:29:50 +02:00
Safihre 7cbbff727f Remove (almost) all references to unused team@sabnzbd.org 2023-07-21 11:33:51 +02:00
Safihre 6492cfb430 Update copyright year to 2023 2023-01-25 22:39:49 +01:00
Safihre 557b9ef71d Server timeouts were applied wrongly during testing
Closes #2326
2022-11-03 09:23:17 +01:00
Safihre 9c7b61070b Update copyright year to 2022 2022-01-07 09:29:32 +01:00
Safihre 5e3d237c99 HappyEyeBalls used SSL even though it wasn't needed 2021-11-30 16:19:16 +01:00
Safihre f00cbe89bc Refactor HappyEyeBalls 2021-11-18 20:27:49 +01:00
Safihre faf1a44944 Black formatting update 2021-04-26 10:52:11 +02:00
Sander bdcbc5e011 Internetspeed improve code style (#1848)
* interspeed: better styling

* interspeed: better styling

* interspeed: better styling

* interspeed: better styling ... logging style

* interspeed: tackle Windows' time granularity

* internetspeed: more feedback on naming
2021-04-04 21:01:02 +02:00
jcfp 29c727319d Test adding nzbs (#1760)
* add tests for adding nzbs

* restore clean_cache_dir fixture, unbreak utils tests

* include tests for partial and malformed nzbs

* test handling of prio from nzb metadata category

* update params of test_adding_nzbs_malformed

* add metadata to sabnews nzb creator

* also test with size_limit

* test prio with dupe detection

* remove leftover todo entry

* move pause and cleanup to fixture; rename functions
2021-02-02 22:58:20 +01:00
Safihre f0bfb08c2e Update copyright year to 2021 2021-01-03 20:43:19 +01:00
Sander f31a4440f1 diskspeed: follow pylint's advice, and more pytesting (#1678)
* diskspeed: follow pylint's advice, and more pytesting

* diskspeed: improved hint, catch relevant exceptions

* diskspeed: lower tun time to 0.5 s (as we run it twice)

* diskspeed: make black and pylint happier

* Delete somefile.txt
2020-11-27 14:34:42 +01:00
Safihre 433dcab02b Update code-style 2020-08-28 10:12:29 +02:00
Safihre f790a9601f Change the macOS power assertion to NoIdleSleep 2020-08-26 08:50:43 +02:00
Safihre 92efc9ed8a Improve automated download-testing
- Catch all Selenium exceptions while waiting for the download to complete
- Correctly set autodisconnect=0
- Make job-name even more unique
- Wait for the RSS-added job to finish fetching
- Move sabnzbd.basic.ini to data folder
- Use new SAB_DATA_DIR
- Optimized imports
2020-06-17 22:33:21 +02:00
Safihre 7e5a43e95c Revert "Code-formatting: optimize imports"
This reverts commit db5ff8c7e1.

Does not work on Python 3.4/3.6. Not really sure why, but don't want to investigate right now.
2020-06-14 11:29:54 +02:00
Safihre db5ff8c7e1 Code-formatting: optimize imports 2020-06-14 10:21:33 +02:00
Safihre 93c62c6827 The tests are just.. flaky
Marking them like this will cause them to be retried once if they fail. This also happens from time to time with the happyeyeballs test.
2020-06-10 13:21:30 +02:00
Safihre 6d8c264e90 Update copyright year to 2020 2020-04-25 16:30:38 +02:00
Safihre 9f777c12ce Code-style corrections for recent commits
Closes #1401
2020-04-25 16:23:05 +02:00
Sander Jonkers 3d2e6904a5 Introduction of unittest for happyeyeballs() 2020-04-22 17:08:35 +02:00
Safihre 1a494cbf14 Move sleepless-test to the right directory 2020-02-26 11:27:38 +01:00
Safihre bc8f3e527a Add Python 3.8 to CI-tests 2019-11-22 15:09:30 +01:00
Saurav Kumar 7fcdad0e69 Added new tests for utils (#1266)
* Added util tests

* FIxed build failures

* Incorportaed review comments

Added new tests

* Test added for generate_key

* Updated module name

* Correct newly added tests
2019-04-22 12:06:26 +02:00