How to use the idom.__main__.main 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_restore(capsys):
    main("restore")
    assert client.installed() == ["htm", "react", "react-dom"]
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_main.py View on Github external
def test_bad_options(capsys, args, error):
    with pytest.raises(type(error), match=str(error)):
        main("--debug", *args)
    with pytest.raises(SystemExit):
        main(*args)
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_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_main.py View on Github external
def test_bad_options(capsys, args, error):
    with pytest.raises(type(error), match=str(error)):
        main("--debug", *args)
    with pytest.raises(SystemExit):
        main(*args)
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_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_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_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