Exemple #1
0
def create_bar():
    with sudo(user='******'), cd('/srv/'):
        if exists('/tmp/foo'):
            mkdir('/tmp/foo/bar')
        else:
            print('/tmp/foo does not exist')
            ls('tamer')
Exemple #2
0
def put_file():
    with sudo(user='******'):
        put('README.md', '/tmp/foobarbaz')
        ls('/tmp/foobarbaz')
        run('cat /tmp/foobarbaz')
        put(StringIO('foobarbazéé'), '/tmp/foobarbaz')
        run('cat /tmp/foobarbaz')
Exemple #3
0
def test_ls(connection, capsys):
    assert 'hosts' in ls('/etc/').stdout
    out, err = capsys.readouterr()
    assert 'hosts' in out
Exemple #4
0
def test_ls_without_list(patch_client):
    assert usine.ls('/tmp/foo', list=False) == \
        "sh -c $'ls --all --human-readable --size /tmp/foo'"
Exemple #5
0
def test_ls_without_all(patch_client):
    assert usine.ls('/tmp/foo', all=False) == \
        "sh -c $'ls --human-readable --size -l /tmp/foo'"
Exemple #6
0
def test_ls_without_human_readable(patch_client):
    assert usine.ls('/tmp/foo', human_readable=False) == \
        "sh -c $'ls --all --size -l /tmp/foo'"
Exemple #7
0
def test_ls(patch_client):
    assert usine.ls('/tmp/foo') == \
        "sh -c $'ls --all --human-readable --size -l /tmp/foo'"