A simple set of BeautifulSoup4 unit test helpers
Project description
Usage
>>> import soup_helpers as sh >>> content = '<head><title>My Title</title></head>' >>> sh.assertPageTitleEquals(content, title='My Title')
Misc Methods
>>> assertLinkWithTextExists(content, url='http://www.example.com', text='My Link')>>> assertPageTitleEquals(content, title='My Title')>>> assertTagWithTextExists(content, tag='p', text='some text')
Form Methods
>>> assertFormFieldExists(content, tag='input', field_name='my_field') >>> assertFormFieldExists(content, tag='select', field_name='my_field') >>> assertFormFieldExists(content, tag='textarea', field_name='my_field')>>> assertInputValueEquals(content, field_name='my_field', value='my value') >>> assertInputValueEquals(content, field_name='my_field', value=None)>>> assertSelectHasOptions(content, field_name='my_field', options_tuple=('One', 'Two'))>>> assertSelectHasSelectedOption(content, field_name='my_field', text='my selected text')>>> assertTextAreaContainsText(content, field_name='my_field', text='some textarea text')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
soup_helpers-0.0.8.zip
(5.3 kB
view details)
File details
Details for the file soup_helpers-0.0.8.zip.
File metadata
- Download URL: soup_helpers-0.0.8.zip
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b94b5cd8c9bcbd163324aadba232e4ee52b69a215d0a5e43d3983e5e8dfe534
|
|
| MD5 |
d76a2c5350e8383b614509132861d68c
|
|
| BLAKE2b-256 |
6fde86ab91b610ed043c38adc46b5c7c89118af3bbafc2a4d4e63fd521b33302
|