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