mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
update docs/tests
This commit is contained in:
parent
aeaff1d663
commit
f55959336b
2 changed files with 5 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ class TestListToString(TestCase):
|
|||
[1,2,3] -> '1; 2; 3'
|
||||
with endsep=='and':
|
||||
[1,2,3] -> '1, 2 and 3'
|
||||
with endsep=='':
|
||||
[1,2,3] -> '1, 2 3'
|
||||
with addquote and endsep="and"
|
||||
[1,2,3] -> '"1", "2" and "3"'
|
||||
"""
|
||||
|
|
@ -76,6 +78,7 @@ class TestListToString(TestCase):
|
|||
self.assertEqual("1, 2, and 3", utils.list_to_string([1, 2, 3]))
|
||||
self.assertEqual("1, 2, 3", utils.list_to_string([1, 2, 3], endsep=","))
|
||||
self.assertEqual("1, 2 and 3", utils.list_to_string([1, 2, 3], endsep="and"))
|
||||
self.assertEqual("1, 2 3", utils.list_to_string([1, 2, 3], endsep=""))
|
||||
self.assertEqual("1; 2; 3", utils.list_to_string([1, 2, 3], sep=";", endsep=";"))
|
||||
self.assertEqual('"1", "2", "3"', utils.list_to_string([1, 2, 3], endsep=",", addquote=True))
|
||||
self.assertEqual(
|
||||
|
|
|
|||
|
|
@ -388,6 +388,8 @@ def iter_to_str(iterable, sep=",", endsep=", and", addquote=False):
|
|||
```python
|
||||
>>> list_to_string([1,2,3], endsep=',')
|
||||
'1, 2, 3'
|
||||
>>> list_to_string([1,2,3], endsep='')
|
||||
'1, 2 3'
|
||||
>>> list_to_string([1,2,3], ensdep='and')
|
||||
'1, 2 and 3'
|
||||
>>> list_to_string([1,2,3], sep=';', endsep=';')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue