← Back
Editing: test_tree.cpython-311.pyc
� oD�c� � �J � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m Z ddlmZm Z mZmZmZmZmZmZmZmZmZ ddlmZ G d � d e� � Z G d� de� � Z G d � de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z G d� de� � Z! G d� de!� � Z" G d� de!� � Z# G d� d e� � Z$ G d!� d"e$� � Z% G d#� d$e$� � Z& G d%� d&e� � Z' G d'� d(e� � Z(dS ))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)�CData�Comment�Declaration�Doctype� Formatter�NavigableString�Script�SoupStrainer� Stylesheet�Tag�TemplateString� )�SoupTestc �0 � e Zd ZdZd� Zd� Zd� Zd� Zd� 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 �p � | � d� � }|� d� � j dk sJ �d S )Nz <a>1</a><b>2</b><a>3</a><b>4</b>�b�2)�soup�find�string��selfr s �5/usr/lib/python3/dist-packages/bs4/tests/test_tree.py� test_find_tagzTestFind.test_find_tag- s8 � ��y�y�;�<�<���y�y��~�~�$��+�+�+�+�+�+� c �h � | � d� � }|� d�� � dk sJ �d S )Nu <h1>Räksmörgås</h1>� Räksmörgås�r )r r r s r �test_unicode_text_findzTestFind.test_unicode_text_find1 s9 � ��y�y�1�2�2���y�y��y�0�0�O�C�C�C�C�C�Cr c � � | � d� � }t |� � d|� d�� � j k sJ �d S )Nu&