How to use removestar - 10 common examples

To help you get started, we’ve selected a few removestar 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 asmeurer / removestar / removestar / test_removestar.py View on Github external
    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))
github asmeurer / removestar / removestar / test_removestar.py View on Github external
def test_get_names_from_dir(tmpdir):
    directory = tmpdir/'module'
    create_module(directory)
    assert get_names_from_dir('.mod1', directory) == {'a', 'aa', 'b'}
    assert get_names_from_dir('.mod2', directory) == {'b', 'c', 'cc'}
    assert get_names_from_dir('.mod3', directory) == {'name'}
    assert get_names_from_dir('.mod4', directory) == {'.mod1.*', '.mod2.*', 'name', 'func'}
    submod = directory/'submod'
    assert get_names_from_dir('.submod1', submod) == {'..mod1.*', '..mod2.*', 'name', 'func'}
    assert get_names_from_dir('..mod1', submod) == {'a', 'aa', 'b'}
    assert get_names_from_dir('..mod2', submod) == {'b', 'c', 'cc'}
    assert get_names_from_dir('..mod3', submod) == {'name'}
    assert get_names_from_dir('..mod4', submod) == {'.mod1.*', '.mod2.*', 'name', 'func'}

    raises(RuntimeError, lambda: get_names_from_dir('.mod_bad', directory))