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

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

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

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

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