예제 #1
0
def test_getitem():
    assert op.getitem(['a', 'b', 'c'], 2) == 'c'
    assert op.getitem(['a', 'b'], 2, 'c') == 'c'
    ran = range(10)
    ran_copy = deepcopy(ran)
    assert op.getitem(ran, 2) == 2
    assert ran == ran_copy
    assert op.getitem({'a':1, 'b':2}, 'b') == 2
예제 #2
0
def test_captcha():
    cmd = '{0} -m minghu6.tools.captcha --help'.format(pypath)
    info_lines, err_lines = exec_cmd(cmd)
    assert getitem(err_lines, 0, 'failed') == ''
    assert info_lines
예제 #3
0
def test_text_editor():
    cmd = '{0} -m minghu6.tools.text_editor --help'.format(pypath)
    info_lines, err_lines = exec_cmd(cmd)
    assert getitem(err_lines, 0, 'failed') == ''
    assert info_lines
예제 #4
0
def test_youtube():
    cmd = '{0} -m minghu6.tools.youtube --help'.format(pypath)
    info_lines, err_lines = exec_cmd(cmd)
    assert getitem(err_lines, 0, 'failed') == ''
    assert info_lines
예제 #5
0
def test_getitem_with_exception_key():
    op.getitem({}, 'key')
예제 #6
0
def test_getitem_with_exception_index():
    op.getitem(range(5), 5)
예제 #7
0
def test_ffmpeg_fix():
    cmd = '{0} -m minghu6.tools.ffmpeg_fix --help'.format(pypath)
    info_lines, err_lines = exec_cmd(cmd)
    assert getitem(err_lines, 0, 'failed') == ''
    assert info_lines
예제 #8
0
파일: echo.py 프로젝트: minghu6/py-minghu6
def interactive():
    echo(getitem(sys.argv, 1, ''))
예제 #9
0
def test_text_editor():
    cmd = '{0} -m minghu6.tools.text_editor --help'.format(pypath)
    info_lines, err_lines = exec_cmd(cmd)
    assert getitem(err_lines, 0, 'failed') == ''
    assert info_lines
예제 #10
0
파일: echo.py 프로젝트: minghu6/minghu6_py
def interactive():
    echo(getitem(sys.argv, 1, ''))
예제 #11
0
파일: echo.py 프로젝트: minghu6/py-minghu6
import sys

from minghu6.algs.operator import getitem

__all__ = ['echo']


def echo(s):
    # sys.stdout.write(s)
    print(s)


if __name__ == '__main__':
    echo(getitem(sys.argv, 1, ''))