コード例 #1
0
ファイル: test_tasks.py プロジェクト: MeaCulpa/fabric
def test_decorator_incompatibility_on_task():
    from fabric.decorators import task, hosts, runs_once, roles
    def foo(): return "foo"
    foo = task(foo)

    # since we aren't setting foo to be the newly decorated thing, its cool
    hosts('me@localhost')(foo)
    runs_once(foo)
    roles('www')(foo)
コード例 #2
0
def test_decorator_incompatibility_on_task():
    from fabric.decorators import task, hosts, runs_once, roles

    def foo():
        return "foo"

    foo = task(foo)

    # since we aren't setting foo to be the newly decorated thing, its cool
    hosts('me@localhost')(foo)
    runs_once(foo)
    roles('www')(foo)
コード例 #3
0
ファイル: test_tasks.py プロジェクト: MeaCulpa/fabric
def test_decorator_closure_hiding():
    from fabric.decorators import task, hosts
    def foo(): print env.host_string
    foo = hosts("me@localhost")(foo)
    foo = task(foo)

    # this broke in the old way, due to closure stuff hiding in the
    # function, but task making an object
    eq_(["me@localhost"], foo.hosts)
コード例 #4
0
def test_decorator_closure_hiding():
    from fabric.decorators import task, hosts

    def foo():
        print env.host_string

    foo = hosts("me@localhost")(foo)
    foo = task(foo)

    # this broke in the old way, due to closure stuff hiding in the
    # function, but task making an object
    eq_(["me@localhost"], foo.hosts)
コード例 #5
0
ファイル: test_main.py プロジェクト: 5minutes/fabric
def test_get_hosts_excludes_cli_exclude_hosts_from_decorator_hosts():
    assert 'foo' not in get_hosts(hosts('foo', 'bar')(dummy), [], [], ['foo'])
コード例 #6
0
def test_get_hosts_excludes_cli_exclude_hosts_from_decorator_hosts():
    def dummy():
        pass

    assert 'foo' not in get_hosts(hosts('foo', 'bar')(dummy), [], [], ['foo'])
コード例 #7
0
ファイル: test_main.py プロジェクト: peterlandry/fabric
def test_get_hosts_excludes_cli_exclude_hosts_from_decorator_hosts():
    assert "foo" not in get_hosts(hosts("foo", "bar")(dummy), [], [], ["foo"])