def test_makedirs_echos_fake_mkdir_command(self, mock_stdout): path = '/some/directory' shell.makedirs(path, echo=True) self.assertEqual(mock_stdout.getvalue(), '>>> mkdir -p {}\n'.format(path))
def test_makedirs_noop_path_exists(self, mock_makedirs): shell.makedirs('/some/directory') mock_makedirs.assert_not_called()
def test_makedirs_creates_path(self, mock_makedirs): path = '/some/directory' shell.makedirs(path) mock_makedirs.assert_called_with(path)
def test_makedirs_converts_pathlib_path(self, mock_convert): path = Path('/some/directory') shell.makedirs(path) mock_convert.assert_called_with(path)