Exemple #1
0
 def test_no_tns_or_namespace_simple(self):
     mock_plugin = Mock()
     item = self.Simple()
     item.document = b'<stuff xmlns="other">'
     type(mock_plugin).defaultNamespace = b"string"
     _ObjectNamespacePlugin.loaded(mock_plugin, item)
     assert item.document == b'<stuff xmlns:tns="string" targetNamespace="string" xmlns="other">'
Exemple #2
0
 def test_loaded_namespace_simple(self):
     mock_plugin = Mock()
     item = self.Simple()
     item.document = b'<stuff xmlns:tns="string" targetNamespace="string" xmlns="other">'
     type(mock_plugin).defaultNamespace = PropertyMock(
         return_value=b"someNamespace")
     _ObjectNamespacePlugin.loaded(mock_plugin, item)