summaryrefslogtreecommitdiff
path: root/bs4/tests/test_soup.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2021-02-13 09:47:34 -0500
committerLeonard Richardson <leonardr@segfault.org>2021-02-13 09:47:34 -0500
commit316093c577193e5e604bb90a16d520e2f5c1b60b (patch)
tree67651fdf2f88c958c1751c56078b7d32f973a1c2 /bs4/tests/test_soup.py
parentc9b6a61f355bcd9161a010156860346cbfdcdc53 (diff)
Corrected output when the namespace prefix associated with a
namespaced attribute is the empty string, as opposed to None. [bug=1915583]
Diffstat (limited to 'bs4/tests/test_soup.py')
-rw-r--r--bs4/tests/test_soup.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py
index 857eb41..f21edfa 100644
--- a/bs4/tests/test_soup.py
+++ b/bs4/tests/test_soup.py
@@ -688,9 +688,19 @@ class TestNamedspacedAttribute(SoupTest):
a = NamespacedAttribute("xmlns", None)
self.assertEqual(a, "xmlns")
+ a = NamespacedAttribute("xmlns", "")
+ self.assertEqual(a, "xmlns")
+
a = NamespacedAttribute("xmlns")
self.assertEqual(a, "xmlns")
+ def test_namespace_may_be_none_or_missing(self):
+ a = NamespacedAttribute(None, "tag")
+ self.assertEqual(a, "tag")
+
+ a = NamespacedAttribute("", "tag")
+ self.assertEqual(a, "tag")
+
def test_attribute_is_equivalent_to_colon_separated_string(self):
a = NamespacedAttribute("a", "b")
self.assertEqual("a:b", a)