示例#1
0
def test_copy_default_attributes(run, attributes):
    run.expects_call()
    (attributes.expects_call().with_args("dst",
                                         mode=None,
                                         owner=None,
                                         group=None))
    file.copy("src", "dst")
示例#2
0
def test_copy_default_attributes(run, attributes):
    run.expects_call()
    (attributes.expects_call().with_args("dst",
                                         mode="foo",
                                         owner="bar",
                                         group="baz"))
    file.copy("src", "dst", mode="foo", owner="bar", group="baz")
示例#3
0
def timezone(zone='UTC'):
    from_file = '/usr/share/zoneinfo/%s' % zone
    to_file = '/etc/localtime'

    with ctx.sudo():
        file.copy(from_file, to_file)
示例#4
0
def test_copy(run):
    run.expects_call().with_args("cp -f src dst")
    file.copy("src", "dst")
示例#5
0
def test_copy_force_false(run):
    run.expects_call().with_args("cp  src dst")
    file.copy("src", "dst", force=False)
示例#6
0
def test_copy_default_attributes(run, attributes):
    run.expects_call()
    (attributes.expects_call().with_args("dst", mode="foo", owner="bar", group="baz"))
    file.copy("src", "dst", mode="foo", owner="bar", group="baz")
示例#7
0
def test_copy_default_attributes(run, attributes):
    run.expects_call()
    (attributes.expects_call().with_args("dst", mode=None, owner=None, group=None))
    file.copy("src", "dst")
示例#8
0
def test_copy_force_false(run):
    run.expects_call().with_args("cp  src dst")
    file.copy("src", "dst", force=False)
示例#9
0
def test_copy(run):
    run.expects_call().with_args("cp -f src dst")
    file.copy("src", "dst")
示例#10
0
def timezone(zone='UTC'):
    with ctx.sudo():
        from_file = '/usr/share/zoneinfo/%s' % zone
        to_file = '/etc/localtime'

        file.copy(from_file, to_file)