torrent.py and platform_ops.py unit tests are now all passing , moving on to integration testing
This commit is contained in:
@@ -34,8 +34,10 @@ def test_ensure_aria2c_returns_existing_executable(monkeypatch):
|
||||
installer.assert_not_called()
|
||||
|
||||
|
||||
def test_ensure_aria2c_returns_windows_path(monkeypatch):
|
||||
def test_ensure_aria2c_windows_returns_installed_binary(monkeypatch):
|
||||
# Arrange
|
||||
expected = r"C:\aria2\aria2c.exe"
|
||||
monkeypatch.setattr(torrent.sys, "platform", "win32")
|
||||
|
||||
monkeypatch.setattr(
|
||||
torrent,
|
||||
@@ -45,7 +47,8 @@ def test_ensure_aria2c_returns_windows_path(monkeypatch):
|
||||
|
||||
assert torrent.ensure_aria2c() == expected
|
||||
|
||||
def test_ensure_aria2c_installs_when_not_found(monkeypatch):
|
||||
def test_ensure_aria2c_windows_installs_when_binary_is_missing(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(
|
||||
torrent,
|
||||
"find_aria2c",
|
||||
@@ -79,6 +82,7 @@ def test_ensure_aria2c_installs_when_not_found(monkeypatch):
|
||||
)
|
||||
|
||||
def test_ensure_aria2c_linux_returns_installed_binary(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(
|
||||
torrent.sys,
|
||||
"platform",
|
||||
@@ -105,6 +109,7 @@ def test_ensure_aria2c_linux_returns_installed_binary(monkeypatch):
|
||||
installer.assert_not_called()
|
||||
|
||||
def test_ensure_aria2c_linux_raises_when_not_installed(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(
|
||||
torrent.sys,
|
||||
"platform",
|
||||
@@ -134,6 +139,9 @@ def test_ensure_aria2c_linux_raises_when_not_installed(monkeypatch):
|
||||
installer.assert_not_called()
|
||||
|
||||
def test_ensure_aria2c_passes_custom_logger(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(torrent.sys, "platform", "win32")
|
||||
|
||||
monkeypatch.setattr(
|
||||
torrent,
|
||||
"find_aria2c",
|
||||
@@ -162,6 +170,9 @@ def test_ensure_aria2c_passes_custom_logger(monkeypatch):
|
||||
|
||||
|
||||
def test_ensure_aria2c_empty_path_triggers_install(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(torrent.sys, "platform", "win32")
|
||||
|
||||
monkeypatch.setattr(
|
||||
torrent,
|
||||
"find_aria2c",
|
||||
@@ -185,6 +196,9 @@ def test_ensure_aria2c_empty_path_triggers_install(monkeypatch):
|
||||
|
||||
|
||||
def test_ensure_aria2c_propagates_installer_failure(monkeypatch):
|
||||
# Arrange
|
||||
monkeypatch.setattr(torrent.sys, "platform", "win32")
|
||||
|
||||
monkeypatch.setattr(
|
||||
torrent,
|
||||
"find_aria2c",
|
||||
|
||||
Reference in New Issue
Block a user