summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2017-05-06 14:32:49 -0400
committerLeonard Richardson <leonardr@segfault.org>2017-05-06 14:32:49 -0400
commit13ec3c3f3010820be225094cc06862cc4b3b2944 (patch)
tree7dfd405d9fe4c415f95bab42daf098d0bdb91da7 /bs4/tests/test_tree.py
parentc556b8a6b42843fac40c55459aa5c494e2798349 (diff)
Added the method, which acts like for
getting the value of an attribute, but which joins attribute multi-values into a single string value. [bug=1678589]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index 354473a..f57255d 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -1286,6 +1286,10 @@ class TestCDAtaListAttributes(SoupTest):
soup = self.soup("<a class='foo\tbar'>")
self.assertEqual(b'<a class="foo bar"></a>', soup.a.encode())
+ def test_attribute_values_joined_into_string_through_string_attr(self):
+ soup = self.soup("<a class='foo\tbar'>")
+ self.assertEqual(b'foo bar', soup.a.string_attr('class'))
+
def test_accept_charset(self):
soup = self.soup('<form accept-charset="ISO-8859-1 UTF-8">')
self.assertEqual(['ISO-8859-1', 'UTF-8'], soup.form['accept-charset'])