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

        with patch('gitfs.views.passthrough.os.fsync', mocked_fsync):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.flush("/magic/path", 0)

            assert result == "magic"
            mocked_fsync.assert_called_once_with(0)
Exemplo n.º 2
0
    def test_flush(self):
        mocked_fsync = MagicMock()
        mocked_fsync.return_value = "magic"

        with patch('gitfs.views.passthrough.os.fsync', mocked_fsync):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.flush("/magic/path", 0)

            assert result == "magic"
            mocked_fsync.assert_called_once_with(0)