@@ -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 : 2023-11-12 22:06 +0800\n "
11
+ "PO-Revision-Date : 2023-11-21 22:16 +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 "
@@ -29,7 +29,7 @@ msgstr "使用 Mock 的方式"
29
29
30
30
#: ../../library/unittest.mock-examples.rst:30
31
31
msgid "Mock Patching Methods"
32
- msgstr "使用 Mock 來 patching methods(方法) "
32
+ msgstr "使用 Mock 來 patching methods 方法 "
33
33
34
34
#: ../../library/unittest.mock-examples.rst:32
35
35
msgid "Common uses for :class:`Mock` objects include:"
@@ -56,17 +56,17 @@ msgid ""
56
56
"Once our mock has been used (``real.method`` in this example) it has methods "
57
57
"and attributes that allow you to make assertions about how it has been used."
58
58
msgstr ""
59
- "一旦我們的 mock 已經被使用(例如在這個範例中的 ``real.method``),它就有了方 "
60
- "法和屬性,允許你對其使用方式進行 assertions (斷言) 。"
59
+ "一旦我們的 mock 已經被使用(例如在這個範例中的 ``real.method``\\ ),它就有了 "
60
+ "方法和屬性,允許你對其使用方式進行斷言 ( assertions) 。"
61
61
62
62
#: ../../library/unittest.mock-examples.rst:50
63
63
msgid ""
64
64
"In most of these examples the :class:`Mock` and :class:`MagicMock` classes "
65
65
"are interchangeable. As the ``MagicMock`` is the more capable class it makes "
66
66
"a sensible one to use by default."
67
67
msgstr ""
68
- "在大多數的範例中,:class:`Mock` 和 :class:`MagicMock` class(類別)是可以互換 "
69
- "的。不過由於 ``MagicMock`` 是功能更強大的類別,因此通常它是一個更好的選擇。"
68
+ "在大多數的範例中,:class:`Mock` 和 :class:`MagicMock` 類別是可以互換的。不過 "
69
+ "由於 ``MagicMock`` 是功能更強大的類別,因此通常它是一個更好的選擇。"
70
70
71
71
#: ../../library/unittest.mock-examples.rst:54
72
72
msgid ""
@@ -89,7 +89,7 @@ msgstr ""
89
89
90
90
#: ../../library/unittest.mock-examples.rst:76
91
91
msgid "Mock for Method Calls on an Object"
92
- msgstr "在物件上的方法呼叫時使用 mock"
92
+ msgstr "對物件的方法呼叫使用 mock"
93
93
94
94
#: ../../library/unittest.mock-examples.rst:78
95
95
msgid ""
@@ -99,16 +99,16 @@ msgid ""
99
99
"used in the correct way."
100
100
msgstr ""
101
101
"在上一個範例中,我們直接對物件上的方法進行 patch,以檢查它是否被正確呼叫。另"
102
- "一個常見的用法是將一個物件傳遞給一個方法(或測試系統的某一部分 ),然後檢查它"
102
+ "一個常見的用法是將一個物件傳遞給一個方法(或受測系統的某一部分 ),然後檢查它"
103
103
"是否以正確的方式被使用。"
104
104
105
105
#: ../../library/unittest.mock-examples.rst:83
106
106
msgid ""
107
107
"The simple ``ProductionClass`` below has a ``closer`` method. If it is "
108
108
"called with an object then it calls ``close`` on it."
109
109
msgstr ""
110
- "下面是一個含有 ``closer`` 方法的單純的 ``ProductionClass``。如果它被一個物件 "
111
- "呼叫 ,它就會呼叫此物件中的 ``close`` 。"
110
+ "下面是一個單純的 ``ProductionClass``,含有一個 ``closer`` 方法。如果它被傳入 "
111
+ "一個物件 ,它就會呼叫此物件中的 ``close``。"
112
112
113
113
#: ../../library/unittest.mock-examples.rst:91
114
114
msgid ""
@@ -125,9 +125,9 @@ msgid ""
125
125
"accessing it in the test will create it, but :meth:`~Mock."
126
126
"assert_called_with` will raise a failure exception."
127
127
msgstr ""
128
- "我們不必為我們的 mock 提供 'close' 方法。 存取 close 會建立它。因此,如果 "
129
- "'close' 並未被呼叫過,在測試流程中存取 'close' 就會建立它,但 :meth:`~Mock. "
130
- "assert_called_with` 就會引發一個失敗的例外。"
128
+ "我們不必做任何額外的事情來為 mock 提供 'close' 方法, 存取 close 會建立它。因 "
129
+ "此,如果 'close' 並未被呼叫過,在測試中存取 'close' 就會建立它,但 :meth:"
130
+ "`~Mock. assert_called_with` 就會引發一個失敗的例外。"
131
131
132
132
#: ../../library/unittest.mock-examples.rst:106
133
133
msgid "Mocking Classes"
0 commit comments