Пример #1
0
def test_require_node_modules_from_string(node_package):
    node_package_dir = nodely.NODE_MODULES_DIR / node_package
    nodely.uninstall(node_package)
    assert not node_package_dir.exists()
    require_node_modules(dist=None,
                         jsmodules="""
    {}
    """.format(node_package))
    assert node_package_dir.isdir()
Пример #2
0
def test_require_node_modules(node_package):
    node_package_dir = nodely.NODE_MODULES_DIR / node_package
    nodely.uninstall(node_package)
    assert not node_package_dir.exists()

    # HACK: Python 3.5 on Travis CI strangely reports missing coverage
    require_node_modules(
        dist=None,
        jsmodules=[  # pragma: no cover
            node_package,
        ])
    assert node_package_dir.isdir()
Пример #3
0
def test_require_node_modules_without_jsmodules(node_package):
    nodely.uninstall(node_package)
    node_modules_content = nodely.NODE_MODULES_DIR.listdir()
    require_node_modules(dist=None)
    assert node_modules_content == nodely.NODE_MODULES_DIR.listdir()
Пример #4
0
def test_require_node_modules_with_wrong_keyword():
    with pytest.raises(AssertionError):
        require_node_modules(dist=None, keyword='wrong')
Пример #5
0
def test_require_node_modules(node_package):
    node_package_dir = nodely.NODE_MODULES_DIR / node_package
    nodely.uninstall(node_package)
    assert not node_package_dir.exists()
    require_node_modules(dist=None, jsmodules=[node_package])
    assert node_package_dir.isdir()