File: //lib/python3/dist-packages/bs4/tests/__pycache__/test_tree.cpython-38.pyc
U
t�^�P � @ sH d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m
Z
mZ ddlm
Z
mZmZmZmZmZmZmZmZ ddlmZmZ e
�d�dk Ze
�d �dk ZG d
d� de�ZG dd
� d
e�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de�Z"G dd� de�Z#G dd� de�Z$G dd� de�Z%G dd� de%�Z&G d d!� d!e%�Z'G d"d#� d#e�Z(G d$d%� d%e(�Z)G d&d'� d'e(�Z*G d(d)� d)e�Z+G d*d+� d+e�Z,G d,d-� d-e�Z-G d.d/� d/e�Z.G d0d1� d1e�Z/G d2d3� d3e�Z0G d4d5� d5e�Z1G d6d7� d7e�Z2G d8d9� d9e�Z3G d:d;� d;e�Z4G d<d=� d=e�Z5dS )>a8 Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
methods tested here.
� )� set_traceN)�
BeautifulSoup)�builder_registry�HTMLParserTreeBuilder) �PY3K�CData�Comment�Declaration�Doctype� Formatter�NavigableString�SoupStrainer�Tag)�SoupTest�skipIfZxmlZlxmlc @ s e Zd Zdd� Zdd� ZdS )�TreeTestc C s | � dd� |D �|� dS )z�Make sure that the given tags have the correct text.
This is used in tests that define a bunch of tags, each
containing a single string, and then select certain strings by
some mechanism.
c S s g | ]
}|j �qS � ��string��.0�tagr r �5/usr/lib/python3/dist-packages/bs4/tests/test_tree.py�
<listcomp>2 s z*TreeTest.assertSelects.<locals>.<listcomp>N��assertEqual��selfZtagsZshould_matchr r r �
assertSelects+ s zTreeTest.assertSelectsc C s | � dd� |D �|� dS )z�Make sure that the given tags have the correct IDs.
This is used in tests that define a bunch of tags, each
containing a single string, and then select certain strings by
some mechanism.
c S s g | ]}|d �qS ��idr r r r r r ; s z-TreeTest.assertSelectsIDs.<locals>.<listcomp>Nr r r r r �assertSelectsIDs4 s zTreeTest.assertSelectsIDsN)�__name__�
__module__�__qualname__r r! r r r r r ) s r c @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
�TestFindz�Basic tests of the find() method.
find() just calls find_all() with limit=1, so it's not tested all
that thouroughly here.
c C s"