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

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

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

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

            assert result == "magic"
            path = '/the/root/path/magic/path'
            mocked_unlink.assert_called_once_with(path)