Skip to content

Commit 27ff3e8

Browse files
committed
docs: 翻譯至rst:99
1 parent 81ed61c commit 27ff3e8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

library/unittest.mock-examples.po

Lines changed: 12 additions & 2 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: 2023-11-03 00:14+0800\n"
11+
"PO-Revision-Date: 2023-11-12 22:06+0800\n"
1212
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -89,7 +89,7 @@ msgstr ""
8989

9090
#: ../../library/unittest.mock-examples.rst:76
9191
msgid "Mock for Method Calls on an Object"
92-
msgstr ""
92+
msgstr "在物件上的方法呼叫時使用 mock"
9393

9494
#: ../../library/unittest.mock-examples.rst:78
9595
msgid ""
@@ -98,18 +98,25 @@ msgid ""
9898
"method (or some part of the system under test) and then check that it is "
9999
"used in the correct way."
100100
msgstr ""
101+
"在上一個範例中,我們直接對物件上的方法進行 patch,以檢查它是否被正確呼叫。另"
102+
"一個常見的用法是將一個物件傳遞給一個方法(或測試系統的某一部分),然後檢查它"
103+
"是否以正確的方式被使用。"
101104

102105
#: ../../library/unittest.mock-examples.rst:83
103106
msgid ""
104107
"The simple ``ProductionClass`` below has a ``closer`` method. If it is "
105108
"called with an object then it calls ``close`` on it."
106109
msgstr ""
110+
"下面是一個含有 ``closer`` 方法的單純的 ``ProductionClass``。如果它被一個物件"
111+
"呼叫,它就會呼叫此物件中的 ``close`` 。"
107112

108113
#: ../../library/unittest.mock-examples.rst:91
109114
msgid ""
110115
"So to test it we need to pass in an object with a ``close`` method and check "
111116
"that it was called correctly."
112117
msgstr ""
118+
"因此,為了對此進行測試,我們需要傳遞一個具有 ``close`` 方法的物件,並檢查它是"
119+
"否被正確的呼叫。"
113120

114121
#: ../../library/unittest.mock-examples.rst:99
115122
msgid ""
@@ -118,6 +125,9 @@ msgid ""
118125
"accessing it in the test will create it, but :meth:`~Mock."
119126
"assert_called_with` will raise a failure exception."
120127
msgstr ""
128+
"我們不必為我們的 mock 提供 'close' 方法。存取 close 會建立它。因此,如果 "
129+
"'close' 並未被呼叫過,在測試流程中存取 'close' 就會建立它,但 :meth:`~Mock."
130+
"assert_called_with` 就會引發一個失敗的例外。"
121131

122132
#: ../../library/unittest.mock-examples.rst:106
123133
msgid "Mocking Classes"

0 commit comments

Comments
 (0)