def test_encoding(self): bundle = MagicMock() bundle.node.name = "localhost" item = files.File( bundle, "/foo", { 'content': "Hellö!".encode("utf-8"), 'encoding': "latin-1", }, ) self.assertEqual( files.content_processor_text(item).decode("latin-1"), "Hellö!", )
def test_template(self): bundle = MagicMock() bundle.node.name = "localhost" item = files.File( bundle, "/foo", { 'content': "Hi from ${node.name}!", 'encoding': "utf-8", }, ) self.assertEqual( files.content_processor_text(item), "Hi from ${node.name}!", )