示例#1
0
    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))
示例#2
0
    def test_makedirs_noop_path_exists(self, mock_makedirs):
        shell.makedirs('/some/directory')

        mock_makedirs.assert_not_called()
示例#3
0
    def test_makedirs_creates_path(self, mock_makedirs):
        path = '/some/directory'

        shell.makedirs(path)

        mock_makedirs.assert_called_with(path)
示例#4
0
    def test_makedirs_converts_pathlib_path(self, mock_convert):
        path = Path('/some/directory')

        shell.makedirs(path)

        mock_convert.assert_called_with(path)