示例#1
0
def test_numeric_wrong():
    c = Chmod('999')
    assert c.getText() == '999'
示例#2
0
def test_numeric_incomplete():
    c = Chmod('77')
    assert c.getText() == '77'
示例#3
0
def test_numeric_bigger():
    c = Chmod('777777777')
    assert c.getText() == '777777777'
示例#4
0
def test_numeric3():
    c = Chmod('644')
    assert c.getText() == 'rw-r--r--'
示例#5
0
def test_numeric4():
    c = Chmod('700')
    assert c.getText() == 'rwx------'
示例#6
0
def test_numeric2():
    c = Chmod('755')
    assert c.getText() == 'rwxr-xr-x'
示例#7
0
def test_numeric1():
    c = Chmod('777')
    assert c.getText() == 'rwxrwxrwx'
示例#8
0
def test_text_same():
    c = Chmod('rwxrwxrwx')
    assert c.getText() == 'rwxrwxrwx'
示例#9
0
文件: api.py 项目: gigante/rwx
def api_chmod(param):
    c = Chmod(param)
    permission['numeric_mode'] = c.getNumeric()
    permission['text_mode'] = c.getText()
    return flask.jsonify(permission)
示例#10
0
文件: cli.py 项目: gigante/rwx
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())