コード例 #1
0
def test_numeric_bigger():
    c = Chmod('777777777')
    assert c.getText() == '777777777'
コード例 #2
0
def test_numeric_same():
    c = Chmod('777')
    assert c.getNumeric() == '777'
コード例 #3
0
def test_numeric_incomplete():
    c = Chmod('77')
    assert c.getText() == '77'
コード例 #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
ファイル: 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)
コード例 #7
0
def test_numeric2():
    c = Chmod('755')
    assert c.getText() == 'rwxr-xr-x'
コード例 #8
0
def test_text_larger():
    c = Chmod('rwxrwxrwxrwx')
    assert c.getNumeric() == 'rwxrwxrwxrwx'
コード例 #9
0
def test_text_wrong_letter():
    c = Chmod('abc')
    assert c.getNumeric() == 'abc'
コード例 #10
0
def test_text_incomplete():
    c = Chmod('rwxrwx')
    assert c.getNumeric() == 'rwxrwx'
コード例 #11
0
def test_text1():
    c = Chmod('rwxrwxrwx')
    assert c.getNumeric() == '777'
コード例 #12
0
def test_text_same():
    c = Chmod('rwxrwxrwx')
    assert c.getText() == 'rwxrwxrwx'
コード例 #13
0
def test_text4():
    c = Chmod('rwx------')
    assert c.getNumeric() == '700'
コード例 #14
0
def test_text3():
    c = Chmod('rw-r--r--')
    assert c.getNumeric() == '644'
コード例 #15
0
def test_numeric_wrong():
    c = Chmod('999')
    assert c.getText() == '999'
コード例 #16
0
def test_numeric1():
    c = Chmod('777')
    assert c.getText() == 'rwxrwxrwx'
コード例 #17
0
def test_text2():
    c = Chmod('rwxr-xr-x')
    assert c.getNumeric() == '755'
コード例 #18
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())