Пример #1
0
    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
    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
 def test_access_with_valid_path_and_no_date(self):
     history = HistoryView()
     assert history.access("/", "mode") == 0
Пример #4
0
    def test_access_with_invalid_path_and_no_date(self):
        history = HistoryView()

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