Skip to content

Commit

Permalink
Test that extracted text is stripped.
Browse files Browse the repository at this point in the history
  • Loading branch information
mscavnicky committed Aug 15, 2020
1 parent c4e139d commit fee525a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_hypotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ def test_log(self):
'INFO:hypotonic:1:<a href="http://books.toscrape.com/index.html">Books to Scrape</a>',
context.output)

def test_extracted_text_is_stripped(self):
data, errors = (
Hypotonic('http://books.toscrape.com/')
.find('.nav-list a')
.set('category')
.data())

self.assertFalse(errors)
self.assertEqual(51, len(data))
for item in data:
self.assertEqual(item['category'], item['category'].strip())

@vcr.use_cassette()
def test_br_tags_become_newlines(self):
data, errors = (
Expand Down

0 comments on commit fee525a

Please sign in to comment.