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
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
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