mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Increase coverage
This commit is contained in:
parent
9d04d62b1c
commit
27d074d760
9 changed files with 93 additions and 3 deletions
0
tests/test_didier/test_data/__init__.py
Normal file
0
tests/test_didier/test_data/__init__.py
Normal file
0
tests/test_didier/test_data/test_embeds/__init__.py
Normal file
0
tests/test_didier/test_data/test_embeds/__init__.py
Normal file
0
tests/test_didier/test_utils/test_types/__init__.py
Normal file
0
tests/test_didier/test_utils/test_types/__init__.py
Normal file
22
tests/test_didier/test_utils/test_types/test_string.py
Normal file
22
tests/test_didier/test_utils/test_types/test_string.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from didier.utils.types.string import leading
|
||||
|
||||
|
||||
def test_leading():
|
||||
"""Test leading() when it actually does something"""
|
||||
assert leading("0", "5") == "05"
|
||||
assert leading("0", "5", target_length=3) == "005"
|
||||
|
||||
|
||||
def test_leading_not_necessary():
|
||||
"""Test leading() when the input is already long enough"""
|
||||
assert leading("0", "05") == "05"
|
||||
|
||||
|
||||
def test_leading_no_exact():
|
||||
"""Test leading() when adding would bring you over the required length"""
|
||||
assert leading("ab", "c", target_length=6) == "abababc"
|
||||
|
||||
|
||||
def test_leading_no_target_length():
|
||||
"""Test leading() when target_length is None"""
|
||||
assert leading("0", "05", target_length=None) == "005"
|
||||
Loading…
Add table
Add a link
Reference in a new issue