コード例 #1
0
def test_cfussy_filter():
    assert_output('cfussy', C_FUSSY_HELLO_WORLD, "HELLO, world\n", ext=".c")
    with wrap() as wrapper:
        wrapper.debug = False
        doc = Doc("hello.c|cfussy", contents=C_HELLO_WORLD, wrapper=wrapper)
        wrapper.run_docs(doc)
        assert wrapper.state == 'error'
コード例 #2
0
def test_bleach_filter():
    assert_output("bleach", "an <script>evil()</script> example",
                  'an &lt;script&gt;evil()&lt;/script&gt; example')
    assert_output("bleach",
                  "an <script>evil()</script> example",
                  'an &lt;script&gt;evil()&lt;/script&gt; example',
                  ext=".html")
コード例 #3
0
ファイル: test_clang_filters.py プロジェクト: GWhized/dexy
def test_cfussy_filter():
    assert_output('cfussy', C_FUSSY_HELLO_WORLD, "HELLO, world\n", ext=".c")
    with wrap() as wrapper:
        wrapper.debug = False
        doc = Doc("hello.c|cfussy",
                contents=C_HELLO_WORLD,
                wrapper=wrapper)
        wrapper.run_docs(doc)
        assert wrapper.state == 'error'
コード例 #4
0
def test_rest_to_html():
    expected = """\
<ul class="simple">
<li>a bullet point using &quot;*&quot;<ul>
<li>a sub-list using &quot;-&quot;<ul>
<li>yet another sub-list</li>
</ul>
</li>
<li>another item</li>
</ul>
</li>
</ul>
"""

    assert_output('rstbody', RST, expected)
コード例 #5
0
def test_rest_to_html():
    expected = """\
<ul class="simple">
<li>a bullet point using &quot;*&quot;<ul>
<li>a sub-list using &quot;-&quot;<ul>
<li>yet another sub-list</li>
</ul>
</li>
<li>another item</li>
</ul>
</li>
</ul>
"""

    assert_output('rstbody', RST, expected)
コード例 #6
0
ファイル: test_example_filters.py プロジェクト: dexy/dexy
def test_process_method_with_dict():
    assert_output("processwithdict", "hello", {'1' : "Dexy processed the text 'hello'"})
コード例 #7
0
ファイル: test_example_filters.py プロジェクト: GWhized/dexy
def test_process_method_with_dict():
    assert_output("processwithdict", "hello", {'1' : "Dexy processed the text 'hello'"})
コード例 #8
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_rhino():
    assert_output('rhino', "print(6*7)", "42\n")
コード例 #9
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_php():
    php = inspect.cleandoc("""<?php
    echo(1+1);
    ?>""")
    assert_output('php', php, "2")
コード例 #10
0
def test_pyg4rst():
    o = {}
    o['1'] = ".. code:: python\n\n  print 'hello'"
    assert_output("pyg4rst", "print 'hello'", o, ext=".py")
コード例 #11
0
def test_fortran_filter():
    assert_output('fortran', FORTRAN_HELLO_WORLD, "Hello, world!", ext=".f")
コード例 #12
0
ファイル: test_standard_filters.py プロジェクト: dexy/dexy
def test_head_filter():
    assert_output("head", "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n",
                  "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
コード例 #13
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_node():
    assert_output("nodejs", "console.log('hello');", "hello\n")
コード例 #14
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_python():
    assert_output('py', 'print(1+1)', "2" + os.linesep)
コード例 #15
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_php():
    php = inspect.cleandoc("""<?php
    echo(1+1);
    ?>""")
    assert_output('php', php, "2")
コード例 #16
0
ファイル: test_lyx_filters.py プロジェクト: GWhized/dexy
def test_lyx():
    assert_output("lyxjinja",
            "dexy:foo.py|idio:multiply",
            "<< d['foo.py|idio']['multiply'] >>",
            ".tex")
コード例 #17
0
ファイル: test_example_filters.py プロジェクト: GWhized/dexy
def test_process_method():
    assert_output("process", "hello", "Dexy processed the text 'hello'")
コード例 #18
0
ファイル: test_example_filters.py プロジェクト: GWhized/dexy
def test_process_text_filter():
    assert_output("processtext", "hello", "Dexy processed the text 'hello'")
コード例 #19
0
ファイル: test_example_filters.py プロジェクト: dexy/dexy
def test_process_method():
    assert_output("process", "hello", "Dexy processed the text 'hello'")
コード例 #20
0
ファイル: test_java_filters.py プロジェクト: dexy/dexy
def test_jython_filter():
    assert_output('jython', "print 1+1", "2\n")
コード例 #21
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_bash():
    assert_output('bash', 'echo "hello"', "hello\n")
コード例 #22
0
ファイル: test_standard_filters.py プロジェクト: dexy/dexy
def test_ppjson_filter():
    assert_output("ppjson", '{"foo" :123, "bar" :456}',
                  """{\n    "bar": 456, \n    "foo": 123\n}""")
コード例 #23
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_rhino():
    assert_output('rhino', "print(6*7)", "42\n")
コード例 #24
0
def test_clang_filter():
    assert_output('clang', C_HELLO_WORLD, "HELLO, world\n", ext=".c")
コード例 #25
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_ruby():
    assert_output('rb', 'puts "hello"', "hello\n")
コード例 #26
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_redclothl():
    expected = "hello \\textbf{bold}" + os.linesep + os.linesep
    assert_output("redclothl", "hello *bold*", expected)
コード例 #27
0
ファイル: test_stdout_filters.py プロジェクト: dexy/dexy
def test_lua():
    assert_output('lua', 'print ("Hello")', "Hello\n")
コード例 #28
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_node():
    assert_output("nodejs", "console.log('hello');", "hello\n")
コード例 #29
0
def test_r_batch():
    assert_output('rout', 'print(1+1)', "[1] 2\n")
コード例 #30
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_lua():
    assert_output('lua', 'print ("Hello")', "Hello\n")
コード例 #31
0
def test_r_int_batch():
    assert_output('rintbatch', '1+1', "> 1+1\n[1] 2\n> \n")
コード例 #32
0
ファイル: test_example_filters.py プロジェクト: dexy/dexy
def test_process_method_manual_write():
    assert_output("processmanual", "hello", "Dexy processed the text 'hello'")
コード例 #33
0
def test_pandoc_filter():
    assert_output("pandoc", "hello", "<p>hello</p>\n", ext=".md")
コード例 #34
0
ファイル: test_example_filters.py プロジェクト: dexy/dexy
def test_process_text_filter():
    assert_output("processtext", "hello", "Dexy processed the text 'hello'")
コード例 #35
0
def test_scalac():
    assert_output('scala',
                  SCALA,
                  "Hello, world!\n",
                  ext=".scala",
                  basename="HelloWorld")
コード例 #36
0
ファイル: test_java_filters.py プロジェクト: dexy/dexy
def test_jruby_filter():
    assert_output('jruby', "puts 1+1", "2\n")
コード例 #37
0
ファイル: test_clang_filters.py プロジェクト: GWhized/dexy
def test_fortran_filter():
    assert_output('fortran', FORTRAN_HELLO_WORLD, "Hello, world!", ext=".f")
コード例 #38
0
ファイル: test_standard_filters.py プロジェクト: dexy/dexy
def test_join_filter():
    contents = json.loads("""[{},
    {"name" : "1", "contents" : "section one" },
    {"name" : "2", "contents" : "section two" }
    ]""")
    assert_output("join", contents, "section one\nsection two")
コード例 #39
0
ファイル: test_clang_filters.py プロジェクト: GWhized/dexy
def test_cpp_filter():
    assert_output('cpp', CPP_HELLO_WORLD, "Hello, world!", ext=".cpp")
コード例 #40
0
ファイル: test_standard_filters.py プロジェクト: dexy/dexy
def test_lines_filter():
    expected = {}
    expected['1'] = "line one"
    expected['2'] = "line two"
    assert_output("lines", "line one\nline two", expected)
コード例 #41
0
ファイル: test_clang_filters.py プロジェクト: GWhized/dexy
def test_clang_filter():
    assert_output('clang', C_HELLO_WORLD, "HELLO, world\n", ext=".c")
コード例 #42
0
ファイル: test_standard_filters.py プロジェクト: dexy/dexy
def test_start_space_filter():
    o = {}
    o['1'] = " abc\n def"
    assert_output("startspace", "abc\ndef", o)
コード例 #43
0
ファイル: test_clang_filters.py プロジェクト: GWhized/dexy
def test_c_filter():
    assert_output('gcc', C_HELLO_WORLD, "HELLO, world\n", ext=".c")
    assert_output('gcc', C_FUSSY_HELLO_WORLD, "HELLO, world\n", ext=".c")
コード例 #44
0
def test_cpp_filter():
    assert_output('cpp', CPP_HELLO_WORLD, "Hello, world!", ext=".cpp")
コード例 #45
0
ファイル: test_sanitize_filters.py プロジェクト: GWhized/dexy
def test_bleach_filter():
    assert_output("bleach", "an <script>evil()</script> example", u'an &lt;script&gt;evil()&lt;/script&gt; example')
    assert_output("bleach", "an <script>evil()</script> example", u'an &lt;script&gt;evil()&lt;/script&gt; example', ext=".html")
コード例 #46
0
def test_c_filter():
    assert_output('gcc', C_HELLO_WORLD, "HELLO, world\n", ext=".c")
    assert_output('gcc', C_FUSSY_HELLO_WORLD, "HELLO, world\n", ext=".c")
コード例 #47
0
ファイル: test_standard_filters.py プロジェクト: GWhized/dexy
def test_join_filter():
    contents = json.loads("""[{},
    {"name" : "1", "contents" : "section one" },
    {"name" : "2", "contents" : "section two" }
    ]""")
    assert_output("join", contents, "section one\nsection two")
コード例 #48
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_redcloth():
    expected = "<p>hello <strong>bold</strong></p>" + os.linesep
    assert_output("redcloth", "hello *bold*", expected)
コード例 #49
0
ファイル: test_standard_filters.py プロジェクト: GWhized/dexy
def test_head_filter():
    assert_output("head", "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n", "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
コード例 #50
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_strings():
    assert_output('strings', "hello\bmore", "hello\nmore\n")
コード例 #51
0
ファイル: test_standard_filters.py プロジェクト: GWhized/dexy
def test_lines_filter():
    expected = {}
    expected['1'] = "line one"
    expected['2'] = "line two"
    assert_output("lines", "line one\nline two", expected)
コード例 #52
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_python():
    assert_output('py', 'print 1+1', "2" + os.linesep)
コード例 #53
0
ファイル: test_standard_filters.py プロジェクト: GWhized/dexy
def test_ppjson_filter():
    assert_output(
            "ppjson",
            '{"foo" :123, "bar" :456}',
            """{\n    "bar": 456, \n    "foo": 123\n}"""
            )
コード例 #54
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_bash():
    assert_output('bash', 'echo "hello"', "hello\n")
コード例 #55
0
def test_pandoc_filter():
    assert_output("pandoc", "hello", "<p>hello</p>\n", ext=".md")
コード例 #56
0
ファイル: test_stdout_filters.py プロジェクト: GWhized/dexy
def test_ruby():
    assert_output('rb', 'puts "hello"', "hello\n")
コード例 #57
0
def test_scalac():
    assert_output('scala', SCALA, "Hello, world!\n", ext=".scala", basename="HelloWorld")
コード例 #58
0
ファイル: test_standard_filters.py プロジェクト: GWhized/dexy
def test_start_space_filter():
    o = {}
    o['1'] = " abc\n def"
    assert_output("startspace", "abc\ndef", o)
コード例 #59
0
ファイル: test_example_filters.py プロジェクト: GWhized/dexy
def test_process_method_manual_write():
    assert_output("processmanual", "hello", "Dexy processed the text 'hello'")