コード例 #1
0
    def test_clear(self, mock_clear: mock.Mock) -> None:
        """Ensure the processor proxies to the global method."""

        p = contextvars.Processor()
        p.clear()
        mock_clear.assert_called_once()
コード例 #2
0
    def test_bind(self, mock_bind: mock.Mock) -> None:
        """Ensure the processor proxies to the global method."""

        p = contextvars.Processor()
        p.bind(a=1, b=2)
        mock_bind.assert_called_once_with(a=1, b=2)
コード例 #3
0
    def test_unbind(self, mock_unbind: mock.Mock) -> None:
        """Ensure the processor proxies to the global method."""

        p = contextvars.Processor()
        p.unbind("a", "b")
        mock_unbind.assert_called_once_with("a", "b")
コード例 #4
0
    def test_merge(self, mock_merge: mock.Mock) -> None:
        """Ensure the processor proxies to the global method."""

        p = contextvars.Processor()
        p.merge({"a": "b"})
        mock_merge.assert_called_once_with({"a": "b"})