How to use the idom.client.delete_web_modules function in idom

To help you get started, we’ve selected a few idom 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 rmorshea / idom / tests / test_main.py View on Github external
def test_simple_install(capsys):
    client.delete_web_modules("jquery", skip_missing=True)

    main("install", "jquery")
    assert client.web_module_exists("jquery")
    main("installed")
    captured = capsys.readouterr()
    assert "- jquery" in captured.out

    with assert_file_is_touched(client.web_module_path("jquery")):
        main("install", "jquery", "--force")
    assert client.web_module_exists("jquery")

    main("uninstall", "jquery")
    assert not client.web_module_exists("jquery")
github rmorshea / idom / tests / test_client / test_manage.py View on Github external
def test_install():
    client.delete_web_modules(["jquery"], skip_missing=True)
    client.install("jquery")

    assert client.web_module_exists("jquery")
    assert client.web_module_exists("/jquery")  # works with a leading slash too
    assert "jquery" in client.installed()
    with assert_file_is_touched(client.web_module_path("jquery")):
        client.install("jquery", force=True)

    with pytest.raises(ValueError, match="already exists"):
        # can't register a module with the same name
        client.register_web_module("jquery", Path() / "some-module.js")

    client.delete_web_modules("jquery")
    assert not client.web_module_exists("jquery")
    assert "jquery" not in client.installed()
github rmorshea / idom / tests / test_main.py View on Github external
def test_install_with_exports(capsys):
    client.delete_web_modules(["preact", "preact/hooks"], skip_missing=True)

    main("install", "preact", "--exports", "preact/hooks")
    assert client.web_module_exists("preact/hooks")
    main("installed")
    captured = capsys.readouterr()
    assert "- preact" in captured.out
    assert "- preact/hooks" in captured.out

    main("uninstall", "preact")
    assert not client.web_module_exists("preact/hooks")
    main("installed")
    captured = capsys.readouterr()
    assert "- preact" not in captured.out
    assert "- preact/hooks" not in captured.out
github rmorshea / idom / tests / test_client / test_manage.py View on Github external
def test_install():
    client.delete_web_modules(["jquery"], skip_missing=True)
    client.install("jquery")

    assert client.web_module_exists("jquery")
    assert client.web_module_exists("/jquery")  # works with a leading slash too
    assert "jquery" in client.installed()
    with assert_file_is_touched(client.web_module_path("jquery")):
        client.install("jquery", force=True)

    with pytest.raises(ValueError, match="already exists"):
        # can't register a module with the same name
        client.register_web_module("jquery", Path() / "some-module.js")

    client.delete_web_modules("jquery")
    assert not client.web_module_exists("jquery")
    assert "jquery" not in client.installed()
github rmorshea / idom / idom / widgets / utils.py View on Github external
def delete(self) -> None:
        if not self._installed:
            raise ValueError("Module is not installed locally")
        client.delete_web_modules([self._name])