@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2023-09-09 00:03+0000\n "
11
- "PO-Revision-Date : 2024-01-23 18:41 +0800\n "
11
+ "PO-Revision-Date : 2024-01-24 18:12 +0800\n "
12
12
"
Last-Translator :
Liang-Bo Wang <[email protected] >\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -455,7 +455,7 @@ msgstr ""
455
455
#: ../../library/unittest.mock-examples.rst:439
456
456
msgid ""
457
457
"The module name can be 'dotted', in the form ``package.module`` if needed::"
458
- msgstr "如有需要,模組名稱可以含有 ``.``,形式為 “ package.module” : ::"
458
+ msgstr "如有需要,模組名稱可以含有 ``.``,形式為 `` package.module`` : ::"
459
459
460
460
#: ../../library/unittest.mock-examples.rst:448
461
461
msgid "A nice pattern is to actually decorate test methods themselves:"
@@ -482,9 +482,9 @@ msgid ""
482
482
"decorators are applied). This means from the bottom up, so in the example "
483
483
"above the mock for ``test_module.ClassName2`` is passed in first."
484
484
msgstr ""
485
- "當你巢狀使用 patch 裝飾器時,mock 會以被應用的順序傳遞到裝飾函數(裝飾器應用 "
486
- "的正常 *Python* 順序 )。這意味著由下而上,因此在上面的範例中, \\ ``module. "
487
- "ClassName2`` 的 mock 會先被傳入。"
485
+ "當你巢狀使用 patch 裝飾器時,mock 傳遞到被裝飾函式的順序會跟其被應用的順序相 "
486
+ "同(一般 *Python* 應用裝飾器的順序 )。這意味著由下而上,因此在上面的範例 "
487
+ "中, \\ ``module. ClassName2`` 的 mock 會先被傳入。"
488
488
489
489
#: ../../library/unittest.mock-examples.rst:487
490
490
msgid ""
@@ -517,11 +517,11 @@ msgid ""
517
517
"decorator individually to every method whose name starts with \" test\" ."
518
518
msgstr ""
519
519
"另外,“patch”、“patch.object” 和 “patch.dict” 也可以用來作為類別裝飾器。以這"
520
- "種方式使用時,與將裝飾器單獨應用於名稱以 “test” 開頭的每個方法相同 。"
520
+ "種方式使用時,與將裝飾器單獨應用於每個名稱以 “test” 開頭的方法相同 。"
521
521
522
522
#: ../../library/unittest.mock-examples.rst:523
523
523
msgid "Further Examples"
524
- msgstr "更多例子 "
524
+ msgstr "更多範例 "
525
525
526
526
#: ../../library/unittest.mock-examples.rst:526
527
527
msgid "Here are some more examples for some slightly more advanced scenarios."
@@ -538,7 +538,7 @@ msgid ""
538
538
"for the first time, or you fetch its ``return_value`` before it has been "
539
539
"called, a new :class:`Mock` is created."
540
540
msgstr ""
541
- "一旦你了解了 :attr:`~Mock.return_value` 屬性,mock 鏈接呼叫其實就很簡單了 。當"
541
+ "一旦你了解了 :attr:`~Mock.return_value` 屬性,mock 鍊接呼叫其實就很簡單了 。當"
542
542
"一個 mock 第一次被呼叫,或者你在它被呼叫之前取得其 ``return_value`` 時,一個"
543
543
"新的 :class:`Mock` 就會被建立。"
544
544
@@ -547,17 +547,17 @@ msgid ""
547
547
"This means that you can see how the object returned from a call to a mocked "
548
548
"object has been used by interrogating the ``return_value`` mock:"
549
549
msgstr ""
550
- "這代表你可以透過訊問 (interrogate) \\ ``return_value`` mock 來了解一個對被 "
551
- "mock 的物件的呼叫回傳的物件是如何被使用的 :"
550
+ "這代表你可以透過查問 ``return_value`` mock 來了解一個對被 mock 的物件的呼叫回 "
551
+ "傳的物件是如何被使用的 :"
552
552
553
553
#: ../../library/unittest.mock-examples.rst:545
554
554
msgid ""
555
555
"From here it is a simple step to configure and then make assertions about "
556
556
"chained calls. Of course another alternative is writing your code in a more "
557
557
"testable way in the first place..."
558
558
msgstr ""
559
- "從這裡開始,只需一個簡單的步驟即可進行配置並對鍊接呼叫進行斷言 。當然,另一種 "
560
- "選擇是先以更容易被測試的方式撰寫程式碼 ..."
559
+ "這裡只需一個簡單的步驟即可進行配置並對鍊接呼叫進行斷言 。當然,另一種選擇是先 "
560
+ "以更容易被測試的方式撰寫程式碼 ..."
561
561
562
562
#: ../../library/unittest.mock-examples.rst:549
563
563
msgid "So, suppose we have some code that looks a little bit like this:"
@@ -569,7 +569,7 @@ msgid ""
569
569
"``method()``? Specifically, we want to test that the code section ``# more "
570
570
"code`` uses the response object in the correct way."
571
571
msgstr ""
572
- "假設 ``BackendProvider`` 已經經過充分測試,那麼我們該如何測試 ``method()``? "
572
+ "假設 ``BackendProvider`` 已經經過充分測試,那麼我們該如何測試 ``method()``?"
573
573
"具體來說,我們要測試程式碼部分 ``# more code`` 是否以正確的方式使用 "
574
574
"``response`` 物件。"
575
575
@@ -603,16 +603,16 @@ msgid ""
603
603
"We can do that in a slightly nicer way using the :meth:`~Mock."
604
604
"configure_mock` method to directly set the return value for us::"
605
605
msgstr ""
606
- "我們可以使用 :meth:`~Mock.configure_mock` 方法來以稍為友善一點的方式為我們直 "
607
- "接設定回傳值 : ::"
606
+ "我們可以使用 :meth:`~Mock.configure_mock` 方法來以稍為好一點的方式為我們直接 "
607
+ "設定回傳值 : ::"
608
608
609
609
#: ../../library/unittest.mock-examples.rst:584
610
610
msgid ""
611
611
"With these we monkey patch the \" mock backend\" in place and can make the "
612
612
"real call::"
613
613
msgstr ""
614
- "有了這些,我們就可以將 \" mock backend\" monkey patch 到位,並且可以進行真正的 "
615
- "呼叫 : ::"
614
+ "有了這些,我們就可以原地 (in place) monkey patch \" mock backend\" ,並且可以進 "
615
+ "行真正的呼叫 : ::"
616
616
617
617
#: ../../library/unittest.mock-examples.rst:590
618
618
msgid ""
@@ -621,9 +621,9 @@ msgid ""
621
621
"be several entries in ``mock_calls``. We can use :meth:`call.call_list` to "
622
622
"create this list of calls for us::"
623
623
msgstr ""
624
- "藉由使用 :attr:`~Mock.mock_calls`,我們可以使用一個斷言來檢查鍊接呼叫。一個鍊 "
625
- "接呼叫是一行程式碼中的多個呼叫 ,因此 ``mock_calls`` 中會有多個條目。我們可以 "
626
- "使用 :meth:`call.call_list` 來為我們建立這個呼叫串列: ::"
624
+ "藉由使用 :attr:`~Mock.mock_calls`,我們可以使用單一一個斷言來檢查鍊接呼叫。一 "
625
+ "個鍊接呼叫是一行程式碼中的多個呼叫 ,因此 ``mock_calls`` 中會有多個項目。我們 "
626
+ "可以使用 :meth:`call.call_list` 來為我們建立這個呼叫串列: ::"
627
627
628
628
#: ../../library/unittest.mock-examples.rst:601
629
629
msgid "Partial mocking"
0 commit comments