예제 #1
0
파일: test_main.py 프로젝트: Oneiroi/fabric
def test_hosts_decorator_overrides_env_hosts_with_task_decorator_last():
    @hosts('bar')
    @task
    def command():
        pass
    eq_hosts(command, ['bar'])
    assert 'foo' not in get_hosts(command, [], [])
예제 #2
0
def test_hosts_decorator_overrides_env_hosts_with_task_decorator_last():
    @hosts('bar')
    @task
    def command():
        pass

    eq_hosts(command, ['bar'])
    assert 'foo' not in get_hosts(command, [], [])
예제 #3
0
def test_hosts_decorator_overrides_env_hosts():
    """
    If @hosts is used it replaces any env.hosts value
    """
    @hosts('bar')
    def command():
        pass
    eq_hosts(command, ['bar'])
    assert 'foo' not in get_hosts(command, [], [])
예제 #4
0
파일: test_main.py 프로젝트: Oneiroi/fabric
def test_hosts_decorator_overrides_env_hosts_with_task_decorator_first():
    """
    If @hosts is used it replaces any env.hosts value even with @task
    """
    @task
    @hosts('bar')
    def command():
        pass
    eq_hosts(command, ['bar'])
    assert 'foo' not in get_hosts(command, [], [])
예제 #5
0
def test_hosts_decorator_overrides_env_hosts_with_task_decorator_first():
    """
    If @hosts is used it replaces any env.hosts value even with @task
    """
    @task
    @hosts('bar')
    def command():
        pass

    eq_hosts(command, ['bar'])
    assert 'foo' not in get_hosts(command, [], [])
예제 #6
0
파일: test_main.py 프로젝트: niklasl/fabric
def test_hosts_decorator_overrides_env_hosts():
    """
    If @hosts is used it replaces any env.hosts value
    """

    @hosts("bar")
    def command():
        pass

    eq_hosts(command, ["bar"])
    assert "foo" not in get_hosts(command, [], [])
예제 #7
0
def eq_hosts(command, host_list):
    eq_(set(get_hosts(command, [], [])), set(host_list))
예제 #8
0
파일: test_main.py 프로젝트: Oneiroi/fabric
def test_get_hosts_excludes_global_exclude_hosts_from_global_hosts():
    assert 'foo' not in get_hosts(dummy, [], [], [])
예제 #9
0
파일: test_main.py 프로젝트: Oneiroi/fabric
def test_get_hosts_excludes_cli_exclude_hosts_from_decorator_hosts():
    assert 'foo' not in get_hosts(hosts('foo', 'bar')(dummy), [], [], ['foo'])
예제 #10
0
파일: test_main.py 프로젝트: Oneiroi/fabric
def test_get_hosts_excludes_cli_exclude_hosts_from_cli_hosts():
    assert 'foo' not in get_hosts(dummy, ['foo', 'bar'], [], ['foo'])