How to use kibitzr - 10 common examples

To help you get started, we’ve selected a few kibitzr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kibitzr / kibitzr / tests / unit / transforms / test_jinja.py View on Github external
def jinja_transform(code, content, conf=None):
    return JinjaTransform(code, conf or {})(content)
github kibitzr / kibitzr / tests / unit / transforms / test_jinja.py View on Github external
def jinja_transform(code, content, conf=None):
    return JinjaTransform(code, conf or {})(content)
github kibitzr / kibitzr / tests / unit / test_conf.py View on Github external
def test_missing_config_raises_configuration_error(exists):
    with pytest.raises(ConfigurationError):
        settings()
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_browser_xpath(target, html_text_conf):
    html_text_conf['transform'].insert(0, {
        'xpath': './/*[@class="footer"]',
    })
    ok, content = Checker(html_text_conf).check()
    assert ok is True
    assert content == 'Footer content'
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_python_script_sample(python_script_conf):
    ok, content = Checker(python_script_conf).check()
    assert ok is True
    assert content == "python"
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_browser_css(target, html_text_conf):
    html_text_conf['transform'].insert(0, {
        'css': '.footer',
    })
    ok, content = Checker(html_text_conf).check()
    assert ok is True
    assert content == 'Footer content'
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_valid_http_404(target, not_found_conf):
    not_found_conf.update({
        'valid_http': [404],
    })
    ok, content = Checker(not_found_conf).check()
    assert ok is True
    assert '404' in content
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_tag_transformer(target, html_text_conf):
    html_text_conf['transform'].insert(0, {
        'tag': 'div',
    })
    ok, content = Checker(html_text_conf).check()
    assert ok is True
    assert content == 'Hello world!'
github kibitzr / kibitzr / tests / simulation / test_forms.py View on Github external
def test_fill_form_sample(target):
    conf = {
        'name': 'Test page',
        'url': "http://{0}:{1}/form.html".format(*target),
        'form': [
            {'id': 'name', 'value': '{{ "name" | sort | join("") }}'},
            {'css': '#pass', 'creds': 'pass'}
        ],
        # 'scenario': 'import pdb; pdb.set_trace()',
        'transform': [{'css': '.unclosed-tag > #params'}, 'text'],
        # 'headless': False,
    }
    ok, content = Checker(conf).check()
    assert ok is True
    assert content == "\n".join([
        "name = aemn",
        "pass = password",
    ])
github kibitzr / kibitzr / tests / simulation / test_fetcher.py View on Github external
def test_simple_fetcher_with_pretty_json(target, json_conf):
    ok, content = Checker(json_conf).check()
    assert ok is True
    assert content == (
        '{\n'
        '  "first name": "Peter",\n'