Пример #1
0
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'
    )
Пример #2
0
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'
    )
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
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')
Пример #7
0
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')