Esempio n. 1
0
    def test_symlink(self, mock_symlink):
        source = '/source/path'
        dest = '/dest/path'

        shell.symlink(source, dest)

        mock_symlink.assert_called_with(source, dest)
Esempio n. 2
0
    def test_symlink_echos_fake_ln_command(self, mock_stdout):
        source = '/source/path'
        dest = '/dest/path'

        shell.symlink(source, dest, echo=True)

        self.assertEqual(mock_stdout.getvalue(),
                         '>>> ln -s {} {}\n'.format(source, dest))
Esempio n. 3
0
    def test_symlink_converts_pathlib_paths(self, mock_convert):
        source = Path('/source/path')
        dest = Path('/dest/path')

        shell.symlink(source, dest)

        mock_convert.assert_has_calls([
            mock.call(source),
            mock.call(dest),
        ])