blob: bdcb5ad35930422418d8dc81929144a0202a939a [file] [log] [blame]
Peter Pentchevb91fc932023-01-19 15:27:13 +02001# SPDX-FileCopyrightText: StorPool <support@storpool.com>
2# SPDX-License-Identifier: BSD-2-Clause
3"""Test the gifn_apply.util functions."""
4
5import pytest
6
7from gifn_apply import util
8
9
10@pytest.mark.parametrize(
11 ("value", "prefix", "expected"),
12 [
13 ("hello", "goodbye", "hello"),
14 ("hello", "hel", "lo"),
15 ("hel", "hello", "hel"),
16 ("hello", "hello", ""),
17 ],
18)
19def test_remove_prefix(value: str, prefix: str, expected: str) -> None:
20 """Test our hand-rolled str.removeprefix() implementation."""
21 assert util.str_removeprefix(value, prefix) == expected