当前位置: 首页>>代码示例>>Python>>正文


Python minitest.ok函数代码示例

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


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


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