コード例 #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'])