Exemplo n.º 1
0
    def test_symlink(self):
        mocked_symlink = MagicMock()
        mocked_symlink.return_value = "magic"

        with patch('gitfs.views.passthrough.os.symlink', mocked_symlink):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.symlink("/magic/path", "/magic/link")

            assert result == "magic"
            path = '/the/root/path/magic/path'
            link = '/the/root/path/magic/link'
            mocked_symlink.assert_called_once_with(path, link)
Exemplo n.º 2
0
    def test_symlink(self):
        mocked_symlink = MagicMock()
        mocked_symlink.return_value = "magic"

        with patch('gitfs.views.passthrough.os.symlink', mocked_symlink):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.symlink("/magic/path", "/magic/link")

            assert result == "magic"
            path = '/the/root/path/magic/path'
            link = '/the/root/path/magic/link'
            mocked_symlink.assert_called_once_with(path, link)