forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -46,29 +46,6 @@ def test_a_nearly_full_temp_volume_is_named_on_the_line(temp: Path, monkeypatch:
|
||||
assert line == f" CalledProcessError: {str(error).rstrip('.')}, 38.0 MB free on {temp}"
|
||||
|
||||
|
||||
def test_enough_free_space_leaves_the_line_as_it_was(temp: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
free_space(monkeypatch, LOW_FREE_SPACE)
|
||||
error = ValueError("boom")
|
||||
|
||||
assert dl.failure_lines(error) == [":x: Download Failed...", " ValueError: boom"]
|
||||
|
||||
|
||||
def test_a_temp_dir_that_cannot_be_read_adds_nothing(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(config.directories, "temp", tmp_path / "missing")
|
||||
|
||||
assert dl.failure_lines(ValueError("boom"))[1] == " ValueError: boom"
|
||||
|
||||
|
||||
def test_a_later_report_reuses_the_first_reading(temp: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
reads = free_space(monkeypatch, 38_000_000)
|
||||
error = OSError(28, "No space left on device")
|
||||
first = dl.failure_lines(error)
|
||||
free_space(monkeypatch, 5 * LOW_FREE_SPACE)
|
||||
|
||||
assert dl.failure_lines(error) == first
|
||||
assert len(reads) == 1
|
||||
|
||||
|
||||
def test_a_click_exception_keeps_only_its_message(temp: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
reads = free_space(monkeypatch, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user