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

Python minitest.ok函数代码示例

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

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



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

示例1: test_block_quotes

 def test_block_quotes(self):
     text = self.br.render(
         'A wise man once said:\n\n'
         ' > Isn\'t it wonderful just to be alive.\n')
     ok(text).diff('<p>A wise man once said:</p>\n'
                   '<blockquote cite="my">\n'
                   '<p>Isn&#39;t it wonderful just to be alive.</p>\n</blockquote>')
开发者ID:hhatto,项目名称:python-hoedown,代码行数:7,代码来源:hoedown_test.py


示例2: test_headings_with_trailing_space

 def test_headings_with_trailing_space(self):
     markdown = self.render_with(
         'The Ant-Sugar Tales \n' \
         '=================== \n\n' \
         'By Candice Yellowflower   \n',
         extensions=EXT_LAX_HTML_BLOCKS)
     ok(markdown).diff('<h1>The Ant-Sugar Tales </h1>\n\n<p>By Candice Yellowflower   </p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:7,代码来源:misaka_test.py


示例3: test_block_quotes_preceded_by_spaces

 def test_block_quotes_preceded_by_spaces(self):
     markdown = self.r(
         'A wise man once said:\n\n' \
         ' > Isn\'t it wonderful just to be alive.\n')
     ok(markdown).diff(
         '<p>A wise man once said:</p>\n\n' \
         '<blockquote>\n<p>Isn&#39;t it wonderful just to be alive.</p>\n</blockquote>\n')
开发者ID:aleray,项目名称:misaka,代码行数:7,代码来源:misaka_test.py


示例4: test_inline_markdown_start_end

    def test_inline_markdown_start_end(self):
        markdown = self.render_with('_start _ foo_bar bar_baz _ end_ *italic* **bold** <a>_blah_</a>',
            extensions=EXT_NO_INTRA_EMPHASIS)
        ok(markdown).diff('<p><em>start _ foo_bar bar_baz _ end</em> <em>italic</em> <strong>bold</strong> <a><em>blah</em></a></p>\n')

        markdown = self.r('Run \'rake radiant:extensions:rbac_base:migrate\'')
        ok(markdown).diff('<p>Run &#39;rake radiant:extensions:rbac_base:migrate&#39;</p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:7,代码来源:misaka_test.py


示例5: test_whitespace_after_urls

 def test_whitespace_after_urls(self):
     markdown = self.render_with('Japan: http://www.abc.net.au/news/events/'
                                 'japan-quake-2011/beforeafter.htm (yes, japan)',
                                 extensions=EXT_AUTOLINK)
     ok(markdown).diff('<p>Japan: <a href="http://www.abc.net.au/news/events/'
                       'japan-quake-2011/beforeafter.htm">http://www.abc.net.'
                       'au/news/events/japan-quake-2011/beforeafter.htm</a> (yes, japan)</p>\n')
开发者ID:hhatto,项目名称:python-hoedown,代码行数:7,代码来源:hoedown_test.py


示例6: test_tables

    def test_tables(self):
        text = ' aaa | bbbb\n' \
            '-----|------\n' \
            'hello|sailor\n'

        ok(self.render_with(text)).not_contains('<table')
        ok(self.render_with(text, extensions=EXT_TABLES)).contains('<table')
开发者ID:aleray,项目名称:misaka,代码行数:7,代码来源:misaka_test.py


示例7: test_infinite_loop_in_header

 def test_infinite_loop_in_header(self):
     markdown = self.render_with(
         '######\n' \
         '#Body#\n' \
         '######\n',
         extensions=EXT_LAX_HTML_BLOCKS)
     ok(markdown).diff('<h1>Body</h1>\n')
开发者ID:aleray,项目名称:misaka,代码行数:7,代码来源:misaka_test.py


示例8: test_html_block_not_wrapped_in_p

 def test_html_block_not_wrapped_in_p(self):
     markdown = self.render_with(
         'Things to watch out for\n' \
         '<ul>\n<li>Blah</li>\n</ul>\n',
         extensions=EXT_LAX_HTML_BLOCKS)
     ok(markdown).diff(
         '<p>Things to watch out for</p>\n\n' \
         '<ul>\n<li>Blah</li>\n</ul>\n')
开发者ID:aleray,项目名称:misaka,代码行数:8,代码来源:misaka_test.py


示例9: test_hard_wrap

    def test_hard_wrap(self):
        markdown = self.render_with(HTML_HARD_WRAP, '''
Hello world,
this is just a simple test

With hard wraps
and other *things*.''')
        ok(markdown).contains('<br>')
开发者ID:aleray,项目名称:misaka,代码行数:8,代码来源:misaka_test.py


示例10: test_autolinking_with_ent_chars

 def test_autolinking_with_ent_chars(self):
     markdown = self.render_with('This a stupid link: https://github.com/'
                                 'rtomayko/tilt/issues?milestone=1&state=open',
                                 extensions=EXT_AUTOLINK)
     ok(markdown).diff('<p>This a stupid link: <a href=\"https://github.com/'
                       'rtomayko/tilt/issues?milestone=1&amp;state=open\">'
                       'https://github.com/rtomayko/tilt/issues?milestone=1'
                       '&amp;state=open</a></p>\n')
开发者ID:hhatto,项目名称:python-hoedown,代码行数:8,代码来源:hoedown_test.py


示例11: test_unicode

    def test_unicode(self):
        tests_dir = path.dirname(__file__)

        with codecs.open(path.join(tests_dir, 'unicode.txt'), 'r', encoding='utf-8') as fd:
            text = fd.read()
        with codecs.open(path.join(tests_dir, 'unicode.html'), 'r', encoding='utf-8') as fd:
            html = fd.read()

        markdown = self.r(text)
        ok(markdown).diff(html)
开发者ID:aleray,项目名称:misaka,代码行数:10,代码来源:misaka_test.py


示例12: test

        def test():
            with codecs.open(text_path, 'r', encoding='utf-8') as fd:
                text = fd.read()
            with codecs.open(html_path, 'r', encoding='utf-8') as fd:
                expected_html = fd.read()

            actual_html = self.r(text)
            expected_result = clean_html(expected_html)
            actual_result = clean_html(actual_html)

            ok(actual_result).diff(expected_result)
开发者ID:aleray,项目名称:misaka,代码行数:11,代码来源:misaka_test.py


示例13: test_fenced_code_blocks

    def test_fenced_code_blocks(self):
        text = '''
This is a simple test

~~~~~
This is some awesome code
    with tabs and shit
~~~
'''

        ok(self.render_with(text)).not_contains('<code')
        ok(self.render_with(text, extensions=EXT_FENCED_CODE)).contains('<code')
开发者ID:aleray,项目名称:misaka,代码行数:12,代码来源:misaka_test.py


示例14: test_escape_html

    def test_escape_html(self):
        source = '''
Through <em>NO</em> <script>DOUBLE NO</script>

<script>BAD</script>

<img src="/favicon.ico" />
'''

        expected = clean_html('''
<p>Through &lt;em&gt;NO&lt;/em&gt; &lt;script&gt;DOUBLE NO&lt;/script&gt;</p>

<p>&lt;script&gt;BAD&lt;/script&gt;</p>

<p>&lt;img src=&quot;/favicon.ico&quot; /&gt;</p>
''')

        markdown = clean_html(self.render_with(HTML_ESCAPE, source))
        ok(markdown).diff(expected)
开发者ID:aleray,项目名称:misaka,代码行数:19,代码来源:misaka_test.py


示例15: test_get_and_set

    def test_get_and_set(self):
        self.db.get('test_get_and_set', callback=self.stop)
        ok(self.wait()) == None

        self.db.set('test_get_and_set', 'value', callback=self.stop)
        ok(self.wait()) == 'OK'

        self.db.get('test_get_and_set', callback=self.stop)
        ok(self.wait()) == 'value'
开发者ID:FSX,项目名称:akane,代码行数:9,代码来源:server_commands.py


示例16: test_exists

    def test_exists(self):
        self.db.set('test_exists', 'value', callback=self.stop)
        ok(self.wait()) == 'OK'

        self.db.exists('test_exists', callback=self.stop)
        ok(self.wait()) == 1

        self.db.exists('test_not_exists', callback=self.stop)
        ok(self.wait()) == 0
开发者ID:FSX,项目名称:akane,代码行数:9,代码来源:server_commands.py


示例17: test_single_quotes_d

 def test_single_quotes_d(self):
     html = self.r('<p>what\'d you say?</p>\n')
     ok(html).diff('<p>what&rsquo;d you say?</p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:3,代码来源:misaka_test.py


示例18: test_single_quotes_m

 def test_single_quotes_m(self):
     html = self.r('<p>I\'m not kidding</p>\n')
     ok(html).diff('<p>I&rsquo;m not kidding</p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:3,代码来源:misaka_test.py


示例19: test_single_quotes_ve

 def test_single_quotes_ve(self):
     html = self.r('<p>I\'ve been meaning to tell you ..</p>\n')
     ok(html).diff('<p>I&rsquo;ve been meaning to tell you ..</p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:3,代码来源:misaka_test.py


示例20: test_double_quotes_to_curly_quotes

 def test_double_quotes_to_curly_quotes(self):
     html = self.r('<p>"Quoted text"</p>\n')
     ok(html).diff('<p>&ldquo;Quoted text&rdquo;</p>\n')
开发者ID:aleray,项目名称:misaka,代码行数:3,代码来源:misaka_test.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python minitwisted.ThreadedReactor类代码示例发布时间:2022-05-27
下一篇:
Python minisom.MiniSom类代码示例发布时间: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