HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/samba/tests/__pycache__/graph.cpython-310.pyc
o

�/a�i�@s\dZddlZddlZddlmZddlZddlZGdd�dejj�ZGdd�dejj	�Z
dS)zTests for samba.graph�N)�graphc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�DotFileTestscCs*t�||�}|dur|�d||f�|S)Nz%r did not match /%s/)�re�match�fail)�self�exp�s�m�r�3/usr/lib/python3/dist-packages/samba/tests/graph.py�assertMatch!szDotFileTests.assertMatchcCs�|�|dd�|r
d}nd}|�||d�|�d|d�}|�|�d�|�|�d|d	�|�d
|d�|�|dd
�|�|dd�dS)Nrz/* generated by samba */z^digraph \w+ {$z
^graph \w+ {$�z^label="([\w ]+)";$�z^fontsize=10;$��$��z&node[fontname=Helvetica; fontsize=10];��)�assertEqualr
�group)r�lines�title�directedrr
rrr�assertHeader'szDotFileTests.assertHeadercCs6t||�D]\}}|�d|�}|�||�d��qdS)Nz
^"(\w+)";$r��zipr
rr)rr�names�n�liner
rrr�assertVertices5s�zDotFileTests.assertVerticesc
Cs�|rdnd}t||�D]7\}}|\}}|�d|�}	|�|	�d�|�|�|	�d�|�|�|	�d�|�|	�d�rB|�d|	�d��qdS)	Nz->z--z.^"(\w+)" ([>-]{2}) "(\w+)" ?(?:\[([^\]])\])?;$rrrrz^[\w ]*$r)
rr�edgesr�	connector�edger �a�br
rrr�assertEdges:s�
��zDotFileTests.assertEdgescCstd�}tt�|d��}tt|dd�|dd���}||d|dfg}g}dd�|D�}d|fd	|fd
|fd|fd|ffD]?\}}d
D]8\}	}
d||
f}tj|||	|d�}|�d�}
|�|
||	�|�	|
dd�|�|�
|
t|�dd�||	�qFq@dS)N�abcdefghrr���rcSs,g|]\}}t|�t|�Adkr||f�qS)r)�ord)�.0r%r&rrr�
<listcomp>Os�z5DotFileTests.test_basic_dot_files.<locals>.<listcomp>�allr �ring�no�disjoint))Tr)F�
undirectedz%s %s)rr�
�)�tuple�	itertools�combinations�listrr�	dot_graph�splitrr!r'�len)r�vertices�	all_edges�
line_edges�
ring_edges�no_edges�disjoint_edges�namer"r�tagr�grrrr�test_basic_dot_filesHs0��
 ��z!DotFileTests.test_basic_dot_filesN)�__name__�
__module__�__qualname__r
rr!r'rDrrrrrsrcs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	�
DistanceTestscs&tt|���ttjdd�d�|_dS)NcSs|pdS)Nrr)rArrr�<lambda>msz%DistanceTests.setUp.<locals>.<lambda>)�key)�superrH�setUp�sortedr�COLOUR_SETS�sorted_colour_sets)r��	__class__rrrLgs
�zDistanceTests.setUpcC�xgd�}dddddddd	d
dd�
}d
D]&}|jD] }d||f}tjd|||d�}|j|||dd||fd�qqdS)N)��ant�bat��cat�dog)rT�elephant)rYrX)rUrX)�frogrY)rZrW)rUrY)rYrW)rWrTrVu[
                 destination
         ╭────── ant
         │╭───── bat
         ││╭──── cat
         │││╭─── dog
         ││││╭── elephant
  source │││││╭─ frog
     ant ·1221-
     bat 3·211-
     cat 12·12-
     dog ---·--
elephant 2311·-
    frog 23121·u�
                 destination
         ╭────── ant
         │╭───── bat
         ││╭──── cat
         │││╭─── dog
         ││││╭── elephant
  source │││││╭─ frog
     ant ·1221-
     bat 3·211-
     cat 12·12-
     dog ---·--
elephant 2311·-
    frog 23121·
                u�
                 destination
         ╭────── ant
         │╭───── bat
         ││╭──── cat
         │││╭─── dog
         ││││╭── elephant
  source │││││╭─ frog
     ant ·1221-
     bat 3·211-
     cat 12·12-
     dog ---·--
elephant 2311·-
    frog 23121·
                u�
                 destination
         ╭────── ant
         │╭───── bat
         ││╭──── cat
         │││╭─── dog
         ││││╭── elephant
  source │││││╭─ frog
     ant ·1221-
     bat 3·211-
     cat 12·12-
     dog ---·--
elephant 2311·-
    frog 23121·
                u
                 destination
         ╭────── ant
         │╭───── bat
         ││╭──── cat
         │││╭─── dog
         ││││╭── elephant
  source │││││╭─ frog
     ant ·1221-
     bat 3·211-
     cat 12·12-
     dog ---·--
elephant 2311·-
    frog 23121·
a
                 destination
         ,------ ant
         |,----- bat
         ||,---- cat
         |||,--- dog
         ||||,-- elephant
  source |||||,- frog
     ant 01221-
     bat 30211-
     cat 12012-
     dog ---0--
elephant 23110-
    frog 231210
au
                 destination
         ,------ ant
         |,----- bat
         ||,---- cat
         |||,--- dog
         ||||,-- elephant
  source |||||,- frog
     ant 01221-
     bat 30211-
     cat 12012-
     dog ---0--
elephant 23110-
    frog 231210
au
                 destination
         ,------ ant
         |,----- bat
         ||,---- cat
         |||,--- dog
         ||||,-- elephant
  source |||||,- frog
     ant 01221-
     bat 30211-
     cat 12012-
     dog ---0--
elephant 23110-
    frog 231210
a�
                 destination
         ,------ ant
         |,----- bat
         ||,---- cat
         |||,--- dog
         ||||,-- elephant
  source |||||,- frog
     ant 01221-
     bat 30211-
     cat 12012-
     dog ---0--
elephant 23110-
    frog 231210
a�
                 destination
         ,------ ant
         |,----- bat
         ||,---- cat
         |||,--- dog
         ||||,-- elephant
  source |||||,- frog
     ant 01221-
     bat 30211-
     cat 12012-
     dog ---0--
elephant 23110-
    frog 231210
�
zutf8 True, colour Nonezutf8 True, colour ansizutf8 True, colour ansi-heatmapz utf8 True, colour xterm-256colorz(utf8 True, colour xterm-256color-heatmapzutf8 False, colour Nonezutf8 False, colour ansizutf8 False, colour ansi-heatmapz!utf8 False, colour xterm-256colorz)utf8 False, colour xterm-256color-heatmap�TF�utf8 %s, colour %s��utf8�colourT�Wrong output: %s

%s��strip�msg�rOr�distance_matrix�assertStringsEqual�rr"�expectedr_r`�kr	rrr�test_simple_distanceos2
��

�
���z"DistanceTests.test_simple_distancecCrR)N)rS)rWrU)rUrT)rTrWu�
            destination
       ╭─── ant
       │╭── bat
source ││╭─ cat
   ant ·11
   bat 1·2
   cat 21·
            uk
            destination
       ╭─── ant
       │╭── bat
source ││╭─ cat
   ant ·11
   bat 1·2
   cat 21·
            ug
            destination
       ╭─── ant
       │╭── bat
source ││╭─ cat
   ant ·11
   bat 1·2
   cat 21·
        u�
            destination
       ╭─── ant
       │╭── bat
source ││╭─ cat
   ant ·11
   bat 1·2
   cat 21·
u�
            destination
       ╭─── ant
       │╭── bat
source ││╭─ cat
   ant ·11
   bat 1·2
   cat 21·
zj
            destination
       ,--- ant
       |,-- bat
source ||,- cat
   ant 011
   bat 102
   cat 210
aD
            destination
       ,--- ant
       |,-- bat
source ||,- cat
   ant 011
   bat 102
   cat 210
aD
            destination
       ,--- ant
       |,-- bat
source ||,- cat
   ant 011
   bat 102
   cat 210
a�
            destination
       ,--- ant
       |,-- bat
source ||,- cat
   ant 011
   bat 102
   cat 210
a�
            destination
       ,--- ant
       |,-- bat
source ||,- cat
   ant 011
   bat 102
   cat 210
r[r\r]r^Trarbrerhrrr�test_simple_distance2s.									�\

�
���z#DistanceTests.test_simple_distance2cCrR)N)rS)rUrWrV)rXrT)rX�eelu�
              destination
       ╭───── ant
       │╭──── bat
       ││╭─── cat
       │││╭── dog
source ││││╭─ eel
   ant ·1234
   bat 3·123
   cat 23·12
   dog 123·1
   eel ----·
u�
              destination
       ╭───── ant
       │╭──── bat
       ││╭─── cat
       │││╭── dog
source ││││╭─ eel
   ant ·1234
   bat 3·123
   cat 23·12
   dog 123·1
   eel ----·
u�
              destination
       ╭───── ant
       │╭──── bat
       ││╭─── cat
       │││╭── dog
source ││││╭─ eel
   ant ·1234
   bat 3·123
   cat 23·12
   dog 123·1
   eel ----·
u�
              destination
       ╭───── ant
       │╭──── bat
       ││╭─── cat
       │││╭── dog
source ││││╭─ eel
   ant ·1234
   bat 3·123
   cat 23·12
   dog 123·1
   eel ----·
u�
              destination
       ╭───── ant
       │╭──── bat
       ││╭─── cat
       │││╭── dog
source ││││╭─ eel
   ant ·1234
   bat 3·123
   cat 23·12
   dog 123·1
   eel ----·
z�
              destination
       ,----- ant
       |,---- bat
       ||,--- cat
       |||,-- dog
source ||||,- eel
   ant 01234
   bat 30123
   cat 23012
   dog 12301
   eel ----0
a�
              destination
       ,----- ant
       |,---- bat
       ||,--- cat
       |||,-- dog
source ||||,- eel
   ant 01234
   bat 30123
   cat 23012
   dog 12301
   eel ----0
a�
              destination
       ,----- ant
       |,---- bat
       ||,--- cat
       |||,-- dog
source ||||,- eel
   ant 01234
   bat 30123
   cat 23012
   dog 12301
   eel ----0
aS              destination
       ,----- ant
       |,---- bat
       ||,--- cat
       |||,-- dog
source ||||,- eel
   ant 01234
   bat 30123
   cat 23012
   dog 12301
   eel ----0
am
              destination
       ,----- ant
       |,---- bat
       ||,--- cat
       |||,-- dog
source ||||,- eel
   ant 01234
   bat 30123
   cat 23012
   dog 12301
   eel ----0
r[r\r]r^Trarbrerhrrr�test_simple_distance3�s0






�

�
���z#DistanceTests.test_simple_distance3)rErFrGrLrkrlrn�
__classcell__rrrPrrHes-irH)�__doc__�samba�samba.testsrrr5�tests�TestCaseInTempDirr�TestCaserHrrrr�<module>sF