def install_ppa(name): ensure("python-software-properties") with ctx.cd("/etc/apt/sources.list.d"): name_normalizes = name.replace("/", "-") source_list = "%s-%s.list" % (name_normalizes, server.codename()) if not file.exists(source_list): sudo("add-apt-repository ppa:%s" % name) update()
def install_ppa(name): ensure("python-software-properties") with ctx.cd("/etc/apt/sources.list.d"): name_normalizes = name.replace("/", "-") source_list = "%s-%s.list" % (name_normalizes, server.codename()) if not file.exists(source_list): core.sudo("add-apt-repository ppa:%s" % name) update()
def test_codename(run): (run.expects_call().with_args("lsb_release --codename --short").returns( run_result("foo"))) assert server.codename() == "foo"
def test_codename(run): (run.expects_call() .with_args("lsb_release --codename --short") .returns(run_result("foo"))) assert server.codename() == "foo"