summaryrefslogtreecommitdiff
path: root/bs4/tests/test_soup.py
diff options
context:
space:
mode:
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)