Esempio n. 1
0
def test_shell_path():
    with patch("subprocess.call") as m:
        shell = Shell("echo {path.stem} for {year}")
        shell.run(path=Path("/") / "this" / "isafile.txt",
                  year=2017,
                  simulate=False)
        m.assert_called_with("echo isafile for 2017", shell=True)
def test_shell_path():
    with patch('subprocess.call') as m:
        shell = Shell('echo {path.stem} for {year}')
        shell.run({
            'path': Path('/') / 'this' / 'isafile.txt',
            'year': 2017
        }, False)
        m.assert_called_with('echo isafile for 2017', shell=True)
def test_shell_path():
    with patch("subprocess.call") as m:
        shell = Shell("echo {path.stem} for {year}")
        shell.run({
            "path": Path("/") / "this" / "isafile.txt",
            "year": 2017
        }, False)
        m.assert_called_with("echo isafile for 2017", shell=True)
Esempio n. 4
0
def test_shell_basic():
    with patch('subprocess.call') as m:
        shell = Shell("echo 'Hello World'")
        shell.run(Path('~'), Path('~'), {}, False)
        m.assert_called_with("echo 'Hello World'", shell=True)
Esempio n. 5
0
def test_shell_attrs():
    with patch('subprocess.call') as m:
        shell = Shell('echo {year}')
        shell.run(Path('~'), Path('~'), {'year': 2017}, False)
        m.assert_called_with('echo 2017', shell=True)
Esempio n. 6
0
def test_shell_basic():
    with patch("subprocess.call") as m:
        shell = Shell("echo 'Hello World'")
        shell.run(path=Path.home(), simulate=False)
        m.assert_called_with("echo 'Hello World'", shell=True)
Esempio n. 7
0
def test_shell_args():
    with patch("subprocess.call") as m:
        shell = Shell("echo {year}")
        shell.run(path=Path.home(), year=2017, simulate=False)
        m.assert_called_with("echo 2017", shell=True)
def test_shell_attrs():
    with patch("subprocess.call") as m:
        shell = Shell("echo {year}")
        shell.run({"path": Path.home(), "year": 2017}, False)
        m.assert_called_with("echo 2017", shell=True)