Example #1
0
def test_click(hub):
    """
    Tests that an SLS App can perform click.
    """
    app = App(hub=hub)
    result = app.click(".uri.", "app")
    assert result == {"detail": "Symbol. Object", "kind": 6, "label": "app"}
Example #2
0
def test_cli_click_line_column(patch, runner, echo, app, options, expected):
    """
    Ensures CLI click with custom line and column works.
    """
    with runner.isolated_filesystem():
        patch.object(json, "dumps")
        text = "foobar"
        with open("my.story", "w") as f:
            f.write(text)
        e = runner.invoke(Cli.main, ["click", "my.story", *options])
        app.click.assert_called_with("|click|", text, **expected)
        json.dumps.assert_called_with(App.click(), indent=2, sort_keys=True)
        click.echo.assert_called_with(json.dumps())
        assert e.exit_code == 0