Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
bs4
/
tests
/
__pycache__
/
File Content:
test_tree.cpython-37.opt-1.pyc
B G.�`�0 � @ s d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m Z mZ ddlm Z mZmZmZmZmZmZmZ ddlmZmZ e �d�dk Ze �d �dk ZG d d� de�ZG dd � d e�ZG dd� de�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 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�Z/G d4d5� d5e�Z0G d6d7� d7e�Z1dS )8a8 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�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 �D/opt/alt/python37/lib/python3.7/site-packages/bs4/tests/test_tree.py� <listcomp>1 s z*TreeTest.assertSelects.<locals>.<listcomp>N)�assertEqual)�self�tags�should_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 r : s z-TreeTest.assertSelectsIDs.<locals>.<listcomp>N)r )r r r r r r �assertSelectsIDs3 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"