コード例 #1
0
ファイル: test_history.py プロジェクト: HWL-RobAt/gitfs
    def test_access_with_date_and_valid_path(self):
        mocked_repo = MagicMock()
        mocked_repo.get_commit_dates.return_value = ["tomorrow"]

        history = HistoryView(repo=mocked_repo)
        history.date = "now"

        with pytest.raises(FuseOSError):
            history.access("/", "mode")
コード例 #2
0
ファイル: test_history.py プロジェクト: wlchou/gitfs
    def test_access_with_date_and_invalid_path(self):
        mocked_repo = MagicMock()
        mocked_repo.get_commits_by_date.return_value = ["tomorrow"]

        history = HistoryView(repo=mocked_repo)
        history.date = "now"

        with pytest.raises(FuseOSError):
            history.access("/non", "mode")

        mocked_repo.get_commits_by_date.assert_called_once_with("now")
コード例 #3
0
ファイル: test_history.py プロジェクト: wlchou/gitfs
 def test_access_with_valid_path_and_no_date(self):
     history = HistoryView()
     assert history.access("/", "mode") == 0
コード例 #4
0
ファイル: test_history.py プロジェクト: wlchou/gitfs
    def test_access_with_invalid_path_and_no_date(self):
        history = HistoryView()

        with pytest.raises(FuseOSError):
            history.access("path", "mode")