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")
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")
def timezone(zone='UTC'): from_file = '/usr/share/zoneinfo/%s' % zone to_file = '/etc/localtime' with ctx.sudo(): file.copy(from_file, to_file)
def test_copy(run): run.expects_call().with_args("cp -f src dst") file.copy("src", "dst")
def test_copy_force_false(run): run.expects_call().with_args("cp src dst") file.copy("src", "dst", force=False)
def timezone(zone='UTC'): with ctx.sudo(): from_file = '/usr/share/zoneinfo/%s' % zone to_file = '/etc/localtime' file.copy(from_file, to_file)