Exemple #1
0
def test_text2():
    c = Chmod('rwxr-xr-x')
    assert c.getNumeric() == '755'
Exemple #2
0
def test_text_wrong_letter():
    c = Chmod('abc')
    assert c.getNumeric() == 'abc'
Exemple #3
0
def test_numeric_same():
    c = Chmod('777')
    assert c.getNumeric() == '777'
Exemple #4
0
def test_text1():
    c = Chmod('rwxrwxrwx')
    assert c.getNumeric() == '777'
Exemple #5
0
def test_text_larger():
    c = Chmod('rwxrwxrwxrwx')
    assert c.getNumeric() == 'rwxrwxrwxrwx'
Exemple #6
0
def test_text_incomplete():
    c = Chmod('rwxrwx')
    assert c.getNumeric() == 'rwxrwx'
Exemple #7
0
def test_text4():
    c = Chmod('rwx------')
    assert c.getNumeric() == '700'
Exemple #8
0
def test_text3():
    c = Chmod('rw-r--r--')
    assert c.getNumeric() == '644'
Exemple #9
0
def api_chmod(param):
    c = Chmod(param)
    permission['numeric_mode'] = c.getNumeric()
    permission['text_mode'] = c.getText()
    return flask.jsonify(permission)
Exemple #10
0
def cli_chmod(param):
    c = Chmod(param)
    click.echo(click.style('numeric_mode: ', fg='green') + c.getNumeric())
    click.echo(click.style('text_mode: ', fg='green') + c.getText())