ytdl-sub/tests/unit/script/functions/test_date_functions.py
Jesse Bannon 57fd6901e4
[DEV] Linter: Use ruff over black and isort (#1445)
Will eventually replace pylint with ruff
2026-03-09 11:39:01 -07:00

15 lines
528 B
Python

import pytest
from unit.script.conftest import single_variable_output
class TestNumericFunctions:
@pytest.mark.parametrize(
"timestamp, date_format, expected_output",
[
(1596877200, "'%Y%m%d'", "20200808"),
(1596877200, "'%m'", "08"),
],
)
def test_datetime_strftime(self, timestamp: int, date_format: str, expected_output: str):
output = single_variable_output(f"{{%datetime_strftime({timestamp}, {date_format})}}")
assert output == expected_output