コード例 #1
0
    def test_unlink_from_git_dir(self):
        current = CurrentView(repo="repo",
                              repo_path="repo_path",
                              ignore=CachedIgnore())

        with pytest.raises(FuseOSError):
            current.unlink(".git/")
コード例 #2
0
ファイル: test_current.py プロジェクト: Marius786/gitfs
    def test_unlink(self):
        from gitfs.views import current as current_view
        old_unlink = current_view.PassthroughView.unlink
        current_view.PassthroughView.unlink = lambda me, path: "done"

        mocked_index = MagicMock()

        current = CurrentView(repo="repo", uid=1, gid=1,
                              repo_path="repo_path",
                              ignore=CachedIgnore())
        current._stage = mocked_index

        assert current.unlink("/path") == "done"
        message = "Deleted /path"
        mocked_index.assert_called_once_with(remove="/path", message=message)

        current_view.PassthroughView.unlink = old_unlink
コード例 #3
0
ファイル: test_current.py プロジェクト: shaded-enmity/gitfs
    def test_unlink(self):
        from gitfs.views import current as current_view
        old_unlink = current_view.PassthroughView.unlink
        current_view.PassthroughView.unlink = lambda me, path: "done"

        mocked_index = MagicMock()

        current = CurrentView(repo="repo", uid=1, gid=1,
                              repo_path="repo_path",
                              ignore=CachedIgnore())
        current._stage = mocked_index

        assert current.unlink("/path") == "done"
        message = "Deleted /path"
        mocked_index.assert_called_once_with(remove="/path", message=message)

        current_view.PassthroughView.unlink = old_unlink
コード例 #4
0
ファイル: test_current.py プロジェクト: Marius786/gitfs
    def test_unlink_from_git_dir(self):
        current = CurrentView(repo="repo", repo_path="repo_path",
                              ignore=CachedIgnore())

        with pytest.raises(FuseOSError):
            current.unlink(".git/")