• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python etree.RootTreeNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中skcode.etree.RootTreeNode的典型用法代码示例。如果您正苦于以下问题:Python RootTreeNode类的具体用法?Python RootTreeNode怎么用?Python RootTreeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RootTreeNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_render_text_is_important

 def test_render_text_is_important(self):
     """ Test the ``render_text`` method with a "important" flag. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('notabene', NotaBeneTreeNode, attrs={'important': ''})
     output_result = tree_node.render_text('test\ntest2\n')
     expected_result = 'N.B. test\ntest2\n\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_notabene.py


示例2: test_render_text

 def test_render_text(self):
     """ Test the ``render_text`` method. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('code', CodeBlockTreeNode, attrs={'code': 'python'}, content='# Hello World!')
     output_result = tree_node.render_text('')
     expected_result = '1.   # Hello World!\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_codeblocks.py


示例3: test_render_text_with_default_language

 def test_render_text_with_default_language(self):
     """ Test the ``render_text`` method with the default language set. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('code', CodeBlockTreeNode, attrs={}, content='# Hello World!')
     output_result = tree_node.render_text('')
     expected_result = '1.   # Hello World!\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_codeblocks.py


示例4: test_text_rendering_only_whitespaces

 def test_text_rendering_only_whitespaces(self):
     """ Test text rendering with no text. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('not', NotNotationTreeNode)
     rendered_output = tree_node.render_text('    ')
     expected_output = ''
     self.assertEqual(expected_output, rendered_output)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_electronic.py


示例5: test_get_source_link_url

 def test_get_source_link_url(self):
     """ Test the ``get_source_link_url`` method with the "src" attribute set. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('code', CodeBlockTreeNode,
                                          attrs={'src': 'https://github.com/TamiaLab/PySkCode'})
     src_link_url = tree_node.get_source_link_url()
     self.assertEqual('https://github.com/TamiaLab/PySkCode', src_link_url)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_codeblocks.py


示例6: test_text_rendering

 def test_text_rendering(self):
     """ Test text rendering. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('noparse', NoParseTreeNode, content='[u]... some text[/u]')
     rendered_output = tree_node.render_text('')
     expected_output = '[u]... some text[/u]'
     self.assertEqual(expected_output, rendered_output)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_internalspecials.py


示例7: test_html_rendering

 def test_html_rendering(self):
     """ Test HTML rendering. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('not', NotNotationTreeNode)
     rendered_output = tree_node.render_html('RESET')
     expected_output = '<span style="text-decoration:overline; text-transform: uppercase;">RESET</span>'
     self.assertEqual(expected_output, rendered_output)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_electronic.py


示例8: test_render_text_without_video

 def test_render_text_without_video(self):
     """ Test the ``render_text`` method without a valid video ID. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('youtube', YoutubeTreeNode)
     output_result = tree_node.render_text('test')
     expected_result = 'test'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_medias.py


示例9: test_render_html

 def test_render_html(self):
     """ Test the ``render_html`` method. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('task', TodoTaskTreeNode)
     output_result = tree_node.render_html('test')
     expected_result = '<li class="task_pending">test</li>\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_todolists.py


示例10: test_get_youtube_video_id_path_2

    def test_get_youtube_video_id_path_2(self):
        """ Test the ``get_youtube_video_id`` method with a valid youtube link. """

        root_tree_node = RootTreeNode()
        tree_node = root_tree_node.new_child('youtube', YoutubeTreeNode, content='https://youtu.be/something/dQw4w9WgXcQ')
        video_id = tree_node.get_youtube_video_id()
        self.assertEqual('dQw4w9WgXcQ', video_id)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_medias.py


示例11: test_render_text

 def test_render_text(self):
     """ Test the ``render_text`` method. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('youtube', YoutubeTreeNode, content='https://www.youtube.com/watch?v=dQw4w9WgXcQ')
     output_result = tree_node.render_text('test')
     expected_result = 'https://youtu.be/dQw4w9WgXcQ'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_medias.py


示例12: test_render_text_with_no_src_link

 def test_render_text_with_no_src_link(self):
     """ Test the ``render_text`` method without a source link. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('img', ImageTreeNode, attrs={})
     output_result = tree_node.render_text('test')
     expected_result = 'test'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_medias.py


示例13: test_render_html_with_no_src_link

 def test_render_html_with_no_src_link(self):
     """ Test the ``render_html`` method without a source link. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('img', ImageTreeNode, attrs={}, content='')
     output_result = tree_node.render_html('test')
     expected_result = '<img src="" />'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_medias.py


示例14: test_render_text

 def test_render_text(self):
     """ Test the ``render_text`` method with a valid color. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('color', ColorTextTreeNode, attrs={'color': '#FFFFFF'})
     output_result = tree_node.render_text('Hello World!')
     expected_result = 'Hello World!'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_textcolors.py


示例15: test_render_html_is_done

 def test_render_html_is_done(self):
     """ Test the ``render_html`` method with a "done" task. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('task', TodoTaskTreeNode, attrs={'done': ''})
     output_result = tree_node.render_html('test')
     expected_result = '<li class="task_done">test</li>\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_todolists.py


示例16: test_get_color_value_method

 def test_get_color_value_method(self):
     """ Test the ``get_color_value`` method. """
     cls = generate_fixed_color_text_cls('customtype')
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('alert', cls, attrs={})
     color_value = tree_node.get_color_value()
     self.assertEqual('customtype', color_value)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_textcolors.py


示例17: test_render_text_trailing_whitespaces

 def test_render_text_trailing_whitespaces(self):
     """ Test the ``render_text`` method. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('task', TodoTaskTreeNode)
     output_result = tree_node.render_text('    test\ntest2\n    ')
     expected_result = '[ ] test\n    test2\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_todolists.py


示例18: test_text_rendering_with_encoded_html_entities

 def test_text_rendering_with_encoded_html_entities(self):
     """ Test text rendering with encoded HTML entities. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('noparse', NoParseTreeNode, content='[u]... &lt;some text&gt;[/u]')
     rendered_output = tree_node.render_text('')
     expected_output = '[u]... <some text>[/u]'
     self.assertEqual(expected_output, rendered_output)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_internalspecials.py


示例19: test_render_text_is_done

 def test_render_text_is_done(self):
     """ Test the ``render_text`` method with a "done" task. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('task', TodoTaskTreeNode, attrs={'done': ''})
     output_result = tree_node.render_text('test\ntest2\n')
     expected_result = '[x] test\n    test2\n'
     self.assertEqual(expected_result, output_result)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_todolists.py


示例20: test_text_rendering_auto_upper

 def test_text_rendering_auto_upper(self):
     """ Test text rendering. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('not', NotNotationTreeNode)
     rendered_output = tree_node.render_text('reset')
     expected_output = '/RESET'
     self.assertEqual(expected_output, rendered_output)
开发者ID:TamiaLab,项目名称:PySkCode,代码行数:7,代码来源:tests_electronic.py



注:本文中的skcode.etree.RootTreeNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python linalg.dot函数代码示例发布时间:2022-05-27
下一篇:
Python testing.get_data_path函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap