>TZ x d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlm Z d dl
Z
dZn
# e$ r dZY nw xY wdZ
dZdZd Zd
ZdZ ed eeeefZn# e$ r ed eeeefZY nw xY we G d d
e Zd Zd Zd ZddZddZ d dej! fdZ"d Z#d Z$d Z%d Z&d Z'd Z(ddZ)dS ) N)Enumunique)wrapsTFz1.4.4z%valuesz
%file_pathz%yaml_loaderz%unpackz
%index_lenc e Zd ZdZdZdZdS )TestNameFormata
An enum to configure how ``mk_test_name()`` to compose a test name. Given
the following example:
.. code-block:: python
@data("a", "b")
def testSomething(self, value):
...
if using just ``@ddt`` or together with ``DEFAULT``:
* ``testSomething_1_a``
* ``testSomething_2_b``
if using ``INDEX_ONLY``:
* ``testSomething_1``
* ``testSomething_2``
r N)__name__
__module____qualname____doc__DEFAULT
INDEX_ONLY U/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/ddt.pyr r * s$ * GJJJr r c t | t rdS t | t t f r"t t t | S dS )NTF)
isinstance
trivial_typeslisttupleallmap
is_trivial)values r r r E sL %'' +t ED%= ) ) +3z5))***5r c 2 t | t d | S )z2
Method decorator to add unpack feature.
T)setattrUNPACK_ATTR)funcs r unpackr M s
D+t$$$Kr c t | S )z
Method decorator to add to your test methods.
Should be added to methods of instances of ``unittest.TestCase``.
)idata)valuess r datar# V s ==r c 8t t t t fd}|S )a
Method decorator to add to your test methods.
Should be added to methods of instances of ``unittest.TestCase``.
:param iterable: iterable of the values to provide to the test function.
:param index_len: an optional integer specifying the width to zero-pad the
test identifier indices to. If not provided, this will add the fewest
zeros necessary to make all identifiers the same length.
Nc ` t | t t | t | S N)r DATA_ATTR INDEX_LEN)r index_leniterables r wrapperzidata.