def test_escaping(tempdir): special_dir = os.path.join(tempdir, 'special dir with "-char') os.mkdir(special_dir) api = Api('localhost') api.file( dest=os.path.join(special_dir, 'foo.txt'), state='touch' )
def test_extra_vars(): tempdir = tempfile.mkdtemp() try: api = Api('localhost', extra_vars={'path': tempdir}) api.file(dest="{{ path }}/foo.txt", state='touch') assert os.path.exists(tempdir + '/foo.txt') finally: shutil.rmtree(tempdir)
def test_escaping(): tempdir = tempfile.mkdtemp() try: special_dir = os.path.join(tempdir, 'special dir with "-char') os.mkdir(special_dir) api = Api('localhost') api.file(dest=os.path.join(special_dir, 'foo.txt'), state='touch') finally: shutil.rmtree(tempdir)
def test_escaping(): tempdir = tempfile.mkdtemp() try: special_dir = os.path.join(tempdir, 'special dir with "-char') os.mkdir(special_dir) api = Api('localhost') api.file( dest=os.path.join(special_dir, 'foo.txt'), state='touch' ) finally: shutil.rmtree(tempdir)
def test_extra_vars(tempdir): api = Api('localhost', extra_vars={'path': tempdir}) api.file(dest="{{ path }}/foo.txt", state='touch') assert os.path.exists(tempdir + '/foo.txt')