示例#1
0
def test_classify_shell():
    cmd = classify(lines=[
        '$ py.test -x\n',
        'crud\n',
    ])
    expected = {
        'action': 'shell',
        'cwd': None,
        'target': 'py.test -x',
        'content': 'crud\n',
        'indent': 4,
        'line': None,
    }
    assert cmd == expected
示例#2
0
def test_classify_shell():
    cmd = classify(lines=[
        '$ py.test -x\n',
        'crud\n',
    ])
    expected = {
        'action': 'shell',
        'cwd': None,
        'target': 'py.test -x',
        'content': 'crud\n',
        'indent': 4,
        'line': None,
    }
    assert cmd == expected
示例#3
0
def test_classify_chdir_shell():
    cmd = classify(lines=[
        'testing $ echo hi\n',
        'crud\n',
    ])

    expected = {
        'action': 'shell',
        'cwd': 'testing',
        'target': 'echo hi',
        'content': 'crud\n',
        'indent': 4,
        'line': None,
    }

    assert cmd == expected
示例#4
0
def test_classify_chdir_shell():
    cmd = classify(lines=[
        'testing $ echo hi\n',
        'crud\n',
    ])

    expected = {
        'action': 'shell',
        'cwd': 'testing',
        'target': 'echo hi',
        'content': 'crud\n',
        'indent': 4,
        'line': None,
    }

    assert cmd == expected
示例#5
0
def test_classify_write():

    write = classify([
        '# content of test_foo.py\n',
        'def test()\n',
        '    pass\n',
    ])

    expected = {
        'action': 'write',
        'cwd': None,
        'target': 'test_foo.py',
        'content': 'def test()\n    pass\n',
        'indent': 4,
        'line': None,
    }
    assert write == expected
示例#6
0
def test_classify_write():

    write = classify([
        '# content of test_foo.py\n',
        'def test()\n',
        '    pass\n',
    ])

    expected = {
        'action': 'write',
        'cwd': None,
        'target': 'test_foo.py',
        'content': 'def test()\n    pass\n',
        'indent': 4,
        'line': None,
    }
    assert  write == expected