コード例 #1
0
def test_instrument():
    assert not chirp.is_instrumented()
    chirp.instrument_site(True)
    py.test.raises(chirp.ChirpError, chirp.instrument_site, True)
    assert chirp.is_instrumented()
    chirp.instrument_site(False)
    assert not chirp.is_instrumented()
    settings.SKYLARK_CHIRP_INSTRUMENTED = True
    # This only get's triggered if we render a page, so let's do that
    request = get_request_fixture()
    c = RequestContext(request, {})
    sa = SnippetAssembly('dummyapp/snippet/snippet.yaml', c)
    content = sa.dumps()
    assert chirp.is_instrumented()
    settings.SKYLARK_CHIRP_INSTRUMENTED = False
コード例 #2
0
def test_snippet_render():
    request = get_request_fixture()
    c = RequestContext(request, {})
    sa = SnippetAssembly('dummyapp/snippet/snippet.yaml', c)

    content = sa.dumps()

    assert not '<html' in content
    assert not '<head' in content
    assert not '<body' in content
    assert not '<link' in content

    assert "dojo.registerModulePath('DynamicApp.Snippet'" in content

    exist(
        'out/dynamicapp/media/js/chirploaded.js',
        'out/dynamicapp/media/js/templates/chirploaded.html',
    )

    assert 'This is my snippet test' in content
コード例 #3
0
def test_bb_issue_07():
    """
    Issue #7

    The problem that this test is verifying is related to the media/js/templates
    directory being copied before other files in the directory.  Our method that
    checks to see if that directory is stale (needs to be updated) was
    malfunctioning.  It compared the dates on the source and cache directory,
    since they were the same (because we just copied the templates directory) it
    was not allowing the rest of the files to be copied.
    """
    request = get_request_fixture()
    c = RequestContext(request, {})
    sa = SnippetAssembly('dummyapp/issue_bb_07/issue_bb_07.yaml', c)

    content = sa.dumps()

    exist(
        'out/dummyapp/issue_bb_07/media/js/Class.js',
        'out/dummyapp/issue_bb_07/media/js/templates/file.html',
    )
コード例 #4
0
 def render(self, context):
     sa = SnippetAssembly("dummyapp/issue_bb_23/tt_after_sa.yaml", context)
     return sa.dumps();
コード例 #5
0
    def render(self, context):
        sa = SnippetAssembly('dummyapp/snippet/snippet.yaml', context)

        return sa.dumps()
コード例 #6
0
 def render(self, context):
     sa = SnippetAssembly("dummyapp/issue24/sa.yaml", context)
     return sa.dumps();
コード例 #7
0
 def render(self, context):
     sa = SnippetAssembly("dummyapp/tag/tag.yaml", context)
     return sa.dumps()