mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 02:14:04 +00:00
Improve ensure_tuple
This commit is contained in:
parent
76c739a958
commit
c2e44fb583
6 changed files with 44 additions and 5 deletions
0
tests/test_utils/__init__.py
Normal file
0
tests/test_utils/__init__.py
Normal file
19
tests/test_utils/test_ensure_tuple.py
Normal file
19
tests/test_utils/test_ensure_tuple.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright 2019 Ram Rachum and collaborators.
|
||||
# This program is distributed under the MIT license.
|
||||
|
||||
import pysnooper
|
||||
from pysnooper.utils import ensure_tuple
|
||||
|
||||
def test_ensure_tuple():
|
||||
x1 = ('foo', ('foo',), ['foo'], {'foo'})
|
||||
assert set(map(ensure_tuple, x1)) == {('foo',)}
|
||||
|
||||
x2 = (pysnooper.Keys('foo'), (pysnooper.Keys('foo'),),
|
||||
[pysnooper.Keys('foo')], {pysnooper.Keys('foo')})
|
||||
|
||||
assert set(map(ensure_tuple, x2)) == {(pysnooper.Keys('foo'),)}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue