|
12 | 12 | import requests |
13 | 13 |
|
14 | 14 | from batch_img.common import Common |
15 | | -from batch_img.const import NAME, PKG_NAME, VER |
| 15 | +from batch_img.const import PKG_NAME, REPLACE |
16 | 16 | from .helper import DotDict |
17 | 17 |
|
18 | 18 |
|
@@ -299,3 +299,29 @@ def test_get_crop_box(data_get_crop_box): |
299 | 299 | width, height, border_width, expected = data_get_crop_box |
300 | 300 | actual = Common.get_crop_box(width, height, border_width) |
301 | 301 | assert actual == expected |
| 302 | + |
| 303 | + |
| 304 | +@pytest.fixture( |
| 305 | + params=[ |
| 306 | + ( |
| 307 | + Path(f"{dirname(__file__)}/data/HEIC/Cartoon.heic"), |
| 308 | + Path(f"{dirname(__file__)}/.out/"), |
| 309 | + "90cw", |
| 310 | + Path(f"{dirname(__file__)}/.out/Cartoon_90cw.heic"), |
| 311 | + ), |
| 312 | + ( |
| 313 | + Path(f"{dirname(__file__)}/data/HEIC/Cartoon.heic"), |
| 314 | + REPLACE, |
| 315 | + "90cw", |
| 316 | + Path(f"{dirname(__file__)}/data/HEIC/Cartoon_tmp.heic"), |
| 317 | + ), |
| 318 | + ] |
| 319 | +) |
| 320 | +def data_set_out_file(request): |
| 321 | + return request.param |
| 322 | + |
| 323 | + |
| 324 | +def test_set_out_file(data_set_out_file): |
| 325 | + in_path, out_path, extra, expected = data_set_out_file |
| 326 | + actual = Common.set_out_file(in_path, out_path, extra) |
| 327 | + assert actual == expected |
0 commit comments