Example #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")
Example #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")
Example #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)
Example #4
0
def test_copy(run):
    run.expects_call().with_args("cp -f src dst")
    file.copy("src", "dst")
Example #5
0
def test_copy_force_false(run):
    run.expects_call().with_args("cp  src dst")
    file.copy("src", "dst", force=False)
Example #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")
Example #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")
Example #8
0
def test_copy_force_false(run):
    run.expects_call().with_args("cp  src dst")
    file.copy("src", "dst", force=False)
Example #9
0
def test_copy(run):
    run.expects_call().with_args("cp -f src dst")
    file.copy("src", "dst")
Example #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)