sanitize_literal had trouble with empty strings.
[htsworkflow.git] / htsworkflow / util / test / test_rdfhelp.py
index 4fe6769f827b0636cccfdbdd63307981018e7423..34c3200a909de310c8fb9dd48bcb04605aa8a3c9 100644 (file)
@@ -150,6 +150,11 @@ _:a owl:imports "{loc}extra.turtle" .
             self.failUnlessEqual(hello_clean.literal_value['string'],
                                  hello_text)
 
+        def test_sanitize_literal_empty_string(self):
+            value = ""
+            value_node = RDF.Node(value)
+            self.assertEqual(str(sanitize_literal(value_node)), value)
+
         def test_sanitize_literal_html(self):
             hello = "hello <a onload='javascript:alert(\"foo\");' href='http://google.com'>google.com</a>, whats up?"
             hello_clean = 'hello <a href="http://google.com">google.com</a>, whats up?'