Skip to content

Commit 31343fb

Browse files
committed
Remove FFmpegFileExists
1 parent fb73512 commit 31343fb

4 files changed

Lines changed: 3 additions & 93 deletions

File tree

ffmpeg/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
from .errors import (
2-
FFmpegAlreadyExecuted,
3-
FFmpegError,
4-
FFmpegFileExists,
5-
FFmpegFileNotFound,
6-
FFmpegInvalidCommand,
7-
FFmpegUnsupportedCodec,
8-
)
1+
from .errors import FFmpegAlreadyExecuted, FFmpegError, FFmpegFileNotFound, FFmpegInvalidCommand, FFmpegUnsupportedCodec
92
from .ffmpeg import FFmpeg
103
from .progress import Progress
114

ffmpeg/errors.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ class FFmpegAlreadyExecuted(FFmpegError):
3939
"Represents FFmpeg is being executed"
4040

4141

42-
class FFmpegFileExists(FFmpegError):
43-
"Represents the output file already exists. You can overwrite it using the `-y` option"
44-
_patterns = [
45-
r"already exists",
46-
]
47-
48-
4942
class FFmpegFileNotFound(FFmpegError):
5043
"Represents an input file was not found"
5144
_patterns = [

tests/test_asyncio_errors.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33

44
import pytest
55

6-
from ffmpeg import (
7-
FFmpegAlreadyExecuted,
8-
FFmpegFileExists,
9-
FFmpegFileNotFound,
10-
FFmpegInvalidCommand,
11-
FFmpegUnsupportedCodec,
12-
)
6+
from ffmpeg import FFmpegAlreadyExecuted, FFmpegFileNotFound, FFmpegInvalidCommand, FFmpegUnsupportedCodec
137
from ffmpeg.asyncio import FFmpeg
148

159

@@ -36,38 +30,6 @@ async def test_asyncio_raises_already_executed(
3630
await ffmpeg.execute()
3731

3832

39-
@pytest.mark.asyncio
40-
async def test_asyncio_raises_file_exists(
41-
assets_path: Path,
42-
tmp_path: Path,
43-
):
44-
source_path = assets_path / "pier-39.ts"
45-
target_path = tmp_path / "pier-39.mp4"
46-
47-
(
48-
await FFmpeg()
49-
.option("y")
50-
.input(source_path)
51-
.output(
52-
target_path,
53-
codec="copy",
54-
)
55-
.execute()
56-
)
57-
58-
with pytest.raises(FFmpegFileExists):
59-
# Note: pytest sets stdin to a null object, so "Overwrite? [y/N]" prompt will be ignored
60-
(
61-
await FFmpeg()
62-
.input(source_path)
63-
.output(
64-
target_path,
65-
codec="copy",
66-
)
67-
.execute()
68-
)
69-
70-
7133
@pytest.mark.asyncio
7234
async def test_asyncio_raises_file_not_found(
7335
assets_path: Path,

tests/test_errors.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@
22

33
import pytest
44

5-
from ffmpeg import (
6-
FFmpeg,
7-
FFmpegAlreadyExecuted,
8-
FFmpegFileExists,
9-
FFmpegFileNotFound,
10-
FFmpegInvalidCommand,
11-
FFmpegUnsupportedCodec,
12-
)
5+
from ffmpeg import FFmpeg, FFmpegAlreadyExecuted, FFmpegFileNotFound, FFmpegInvalidCommand, FFmpegUnsupportedCodec
136

147

158
def test_raises_already_executed(
@@ -34,37 +27,6 @@ def test_raises_already_executed(
3427
ffmpeg.execute()
3528

3629

37-
def test_raises_file_exists(
38-
assets_path: Path,
39-
tmp_path: Path,
40-
):
41-
source_path = assets_path / "pier-39.ts"
42-
target_path = tmp_path / "pier-39.mp4"
43-
44-
(
45-
FFmpeg()
46-
.option("y")
47-
.input(source_path)
48-
.output(
49-
target_path,
50-
codec="copy",
51-
)
52-
.execute()
53-
)
54-
55-
with pytest.raises(FFmpegFileExists):
56-
# Note: pytest sets stdin to a null object, so "Overwrite? [y/N]" prompt will be ignored
57-
(
58-
FFmpeg()
59-
.input(source_path)
60-
.output(
61-
target_path,
62-
codec="copy",
63-
)
64-
.execute()
65-
)
66-
67-
6830
def test_raises_file_not_found(
6931
assets_path: Path,
7032
tmp_path: Path,

0 commit comments

Comments
 (0)