Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2004a71

Browse filesBrowse files
committed
fix: rebase
1 parent 65003c6 commit 2004a71
Copy full SHA for 2004a71

File tree

Expand file treeCollapse file tree

2 files changed

+25
-25
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+25
-25
lines changed

‎library/unittest.mock-examples.po

Copy file name to clipboardExpand all lines: library/unittest.mock-examples.po
+20-20Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"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"
1212
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -455,7 +455,7 @@ msgstr ""
455455
#: ../../library/unittest.mock-examples.rst:439
456456
msgid ""
457457
"The module name can be 'dotted', in the form ``package.module`` if needed::"
458-
msgstr "如有需要,模組名稱可以含有 ``.``,形式為 package.module: ::"
458+
msgstr "如有需要,模組名稱可以含有 ``.``,形式為 ``package.module``: ::"
459459

460460
#: ../../library/unittest.mock-examples.rst:448
461461
msgid "A nice pattern is to actually decorate test methods themselves:"
@@ -482,9 +482,9 @@ msgid ""
482482
"decorators are applied). This means from the bottom up, so in the example "
483483
"above the mock for ``test_module.ClassName2`` is passed in first."
484484
msgstr ""
485-
"當你巢狀使用 patch 裝飾器時,mock 會以被應用的順序傳遞到裝飾函數(裝飾器應用"
486-
"的正常 *Python* 順序)。這意味著由下而上,因此在上面的範例中,\\ ``module."
487-
"ClassName2`` 的 mock 會先被傳入。"
485+
"當你巢狀使用 patch 裝飾器時,mock 傳遞到被裝飾函式的順序會跟其被應用的順序相"
486+
"同(一般 *Python* 應用裝飾器的順序)。這意味著由下而上,因此在上面的範例"
487+
"中,\\ ``module.ClassName2`` 的 mock 會先被傳入。"
488488

489489
#: ../../library/unittest.mock-examples.rst:487
490490
msgid ""
@@ -517,11 +517,11 @@ msgid ""
517517
"decorator individually to every method whose name starts with \"test\"."
518518
msgstr ""
519519
"另外,“patch”、“patch.object” 和 “patch.dict” 也可以用來作為類別裝飾器。以這"
520-
"種方式使用時,與將裝飾器單獨應用於名稱以 “test” 開頭的每個方法相同。"
520+
"種方式使用時,與將裝飾器單獨應用於每個名稱以 “test” 開頭的方法相同。"
521521

522522
#: ../../library/unittest.mock-examples.rst:523
523523
msgid "Further Examples"
524-
msgstr "更多例子"
524+
msgstr "更多範例"
525525

526526
#: ../../library/unittest.mock-examples.rst:526
527527
msgid "Here are some more examples for some slightly more advanced scenarios."
@@ -538,7 +538,7 @@ msgid ""
538538
"for the first time, or you fetch its ``return_value`` before it has been "
539539
"called, a new :class:`Mock` is created."
540540
msgstr ""
541-
"一旦你了解了 :attr:`~Mock.return_value` 屬性,mock 鏈接呼叫其實就很簡單了。當"
541+
"一旦你了解了 :attr:`~Mock.return_value` 屬性,mock 鍊接呼叫其實就很簡單了。當"
542542
"一個 mock 第一次被呼叫,或者你在它被呼叫之前取得其 ``return_value`` 時,一個"
543543
"新的 :class:`Mock` 就會被建立。"
544544

@@ -547,17 +547,17 @@ msgid ""
547547
"This means that you can see how the object returned from a call to a mocked "
548548
"object has been used by interrogating the ``return_value`` mock:"
549549
msgstr ""
550-
"這代表你可以透過訊問 (interrogate) \\ ``return_value`` mock 來了解一個對被 "
551-
"mock 的物件的呼叫回傳的物件是如何被使用的:"
550+
"這代表你可以透過查問 ``return_value`` mock 來了解一個對被 mock 的物件的呼叫回"
551+
"傳的物件是如何被使用的:"
552552

553553
#: ../../library/unittest.mock-examples.rst:545
554554
msgid ""
555555
"From here it is a simple step to configure and then make assertions about "
556556
"chained calls. Of course another alternative is writing your code in a more "
557557
"testable way in the first place..."
558558
msgstr ""
559-
"從這裡開始,只需一個簡單的步驟即可進行配置並對鍊接呼叫進行斷言。當然,另一種"
560-
"選擇是先以更容易被測試的方式撰寫程式碼..."
559+
"這裡只需一個簡單的步驟即可進行配置並對鍊接呼叫進行斷言。當然,另一種選擇是先"
560+
"以更容易被測試的方式撰寫程式碼..."
561561

562562
#: ../../library/unittest.mock-examples.rst:549
563563
msgid "So, suppose we have some code that looks a little bit like this:"
@@ -569,7 +569,7 @@ msgid ""
569569
"``method()``? Specifically, we want to test that the code section ``# more "
570570
"code`` uses the response object in the correct way."
571571
msgstr ""
572-
"假設 ``BackendProvider`` 已經經過充分測試,那麼我們該如何測試 ``method()``? "
572+
"假設 ``BackendProvider`` 已經經過充分測試,那麼我們該如何測試 ``method()``?"
573573
"具體來說,我們要測試程式碼部分 ``# more code`` 是否以正確的方式使用 "
574574
"``response`` 物件。"
575575

@@ -603,16 +603,16 @@ msgid ""
603603
"We can do that in a slightly nicer way using the :meth:`~Mock."
604604
"configure_mock` method to directly set the return value for us::"
605605
msgstr ""
606-
"我們可以使用 :meth:`~Mock.configure_mock` 方法來以稍為友善一點的方式為我們直"
607-
"接設定回傳值: ::"
606+
"我們可以使用 :meth:`~Mock.configure_mock` 方法來以稍為好一點的方式為我們直接"
607+
"設定回傳值: ::"
608608

609609
#: ../../library/unittest.mock-examples.rst:584
610610
msgid ""
611611
"With these we monkey patch the \"mock backend\" in place and can make the "
612612
"real call::"
613613
msgstr ""
614-
"有了這些,我們就可以將 \"mock backend\" monkey patch 到位,並且可以進行真正的"
615-
"呼叫: ::"
614+
"有了這些,我們就可以原地 (in place) monkey patch \"mock backend\",並且可以進"
615+
"行真正的呼叫: ::"
616616

617617
#: ../../library/unittest.mock-examples.rst:590
618618
msgid ""
@@ -621,9 +621,9 @@ msgid ""
621621
"be several entries in ``mock_calls``. We can use :meth:`call.call_list` to "
622622
"create this list of calls for us::"
623623
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` 來為我們建立這個呼叫串列: ::"
627627

628628
#: ../../library/unittest.mock-examples.rst:601
629629
msgid "Partial mocking"

‎library/unittest.mock.po

Copy file name to clipboardExpand all lines: library/unittest.mock.po
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: Python 3.12\n"
88
"Report-Msgid-Bugs-To: \n"
99
"POT-Creation-Date: 2023-12-16 00:03+0000\n"
10-
"PO-Revision-Date: 2024-01-22 21:47+0800\n"
10+
"PO-Revision-Date: 2024-01-24 18:03+0800\n"
1111
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1212
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1313
"tw)\n"
@@ -16,7 +16,7 @@ msgstr ""
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Plural-Forms: nplurals=1; plural=0;\n"
19-
"X-Generator: Poedit 3.4.1\n"
19+
"X-Generator: Poedit 3.4.2\n"
2020

2121
#: ../../library/unittest.mock.rst:3
2222
msgid ":mod:`unittest.mock` --- mock object library"
@@ -130,9 +130,9 @@ msgid ""
130130
"decorators are applied). This means from the bottom up, so in the example "
131131
"above the mock for ``module.ClassName1`` is passed in first."
132132
msgstr ""
133-
"當你巢狀使用 patch 裝飾器時,mock 會以被應用的順序傳遞到裝飾函數(裝飾器應用"
134-
"的正常 *Python* 順序)。這意味著由下而上,因此在上面的範例中,\\ ``module."
135-
"ClassName1`` 的 mock 會先被傳入。"
133+
"當你巢狀使用 patch 裝飾器時,mock 傳遞到被裝飾函式的順序會跟其被應用的順序相"
134+
"同(一般 *Python* 應用裝飾器的順序)。這意味著由下而上,因此在上面的範例"
135+
"中,``module.ClassName1`` 的 mock 會先被傳入。"
136136

137137
#: ../../library/unittest.mock.rst:122
138138
msgid ""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.