Skip to content

Commit e1311de

Browse files
committed
docs: mock 翻譯
根據review修正
1 parent 48b8e31 commit e1311de

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

library/unittest.mock.po

+14-14
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ msgid ""
230230
"allowing you to make assertions about what your code has done to them."
231231
msgstr ""
232232
":class:`Mock` 是一個彈性的的 mock 物件,旨在代替程式碼中 stubs 和 test "
233-
"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性創建為新"
234-
"的 mock [#]_。存取相同的屬性將永遠返回相同的 mock。Mock 記錄了你如何使用它"
233+
"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性建立為新"
234+
"的 mock [#]_。存取相同的屬性將永遠回傳相同的 mock。Mock 記錄了你如何使用它"
235235
"們,允許你判定你的程式碼對 mock 的行為。"
236236

237237
#: ../../library/unittest.mock.rst:218
@@ -242,7 +242,7 @@ msgid ""
242242
"`NonCallableMock` and :class:`NonCallableMagicMock`"
243243
msgstr ""
244244
":class:`MagicMock` 是 :class:`Mock` 的子類別,其中所有魔術方法均已預先建立並"
245-
"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用:\\ :class:"
245+
"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用::class:"
246246
"`NonCallableMock` 和 :class:`NonCallableMagicMock`"
247247

248248
#: ../../library/unittest.mock.rst:223
@@ -253,15 +253,15 @@ msgid ""
253253
"class of :class:`Mock` using the *new_callable* argument to :func:`patch`."
254254
msgstr ""
255255
":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。"
256-
"默認情況下,\\ :func:`patch` 會為你建立一個 :class:`MagicMock`\\ 。你可以使"
256+
"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使"
257257
"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。"
258258

259259
#: ../../library/unittest.mock.rst:231
260260
msgid ""
261261
"Create a new :class:`Mock` object. :class:`Mock` takes several optional "
262262
"arguments that specify the behaviour of the Mock object:"
263263
msgstr ""
264-
"建立一個新的 :class:`Mock` 對象。\\ :class:`Mock` 接受數個可選的引數來指定 "
264+
"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 "
265265
"Mock 物件的行為:"
266266

267267
#: ../../library/unittest.mock.rst:234
@@ -335,7 +335,7 @@ msgid ""
335335
"is a new Mock (created on first access). See the :attr:`return_value` "
336336
"attribute."
337337
msgstr ""
338-
"*return_value*:當呼叫 mock 時回傳的值。默認情況下,這是一個新的 Mock(在首次"
338+
"*return_value*:當呼叫 mock 時回傳的值。預設情況下,這是一個新的 Mock(在首次"
339339
"存取時建立)。參見 :attr:`return_value` 屬性。"
340340

341341
#: ../../library/unittest.mock.rst:266
@@ -345,7 +345,7 @@ msgid ""
345345
"`AttributeError`. Passing ``unsafe=True`` will allow access to these "
346346
"attributes."
347347
msgstr ""
348-
"*unsafe*:默認情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 "
348+
"*unsafe*:預設情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 "
349349
"*assrt* 開頭的屬性將引發 :exc:`AttributeError`。如果傳遞 ``unsafe=True``\\ ,"
350350
"將會允許存取這些屬性。"
351351

@@ -358,17 +358,17 @@ msgid ""
358358
"to access an attribute that doesn't exist will raise an :exc:"
359359
"`AttributeError`)."
360360
msgstr ""
361-
"*wraps*:被 mock 物件包裹的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將"
362-
"通過被包裹的物件(返回真實結果)。存取 mock 的屬性將會返回一個 Mock 物件,該"
363-
"物件包裹了被包裹物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:"
361+
"*wraps*:被 mock 物件包裝的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將"
362+
"通過被包裝的物件(回傳真實結果)。存取 mock 的屬性將會回傳一個 Mock 物件,該"
363+
"物件包裝了被包裝物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:"
364364
"`AttributeError`\\ )。"
365365

366366
#: ../../library/unittest.mock.rst:280
367367
msgid ""
368368
"If the mock has an explicit *return_value* set then calls are not passed to "
369369
"the wrapped object and the *return_value* is returned instead."
370370
msgstr ""
371-
"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裹的物件,"
371+
"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裝的物件,"
372372
"而是回傳已設定好的 *return_value*。"
373373

374374
#: ../../library/unittest.mock.rst:283
@@ -385,7 +385,7 @@ msgid ""
385385
"used to set attributes on the mock after it is created. See the :meth:"
386386
"`configure_mock` method for details."
387387
msgstr ""
388-
"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在創建 mock 之後用"
388+
"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在建立 mock 之後用"
389389
"於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。"
390390

391391
#: ../../library/unittest.mock.rst:293
@@ -428,7 +428,7 @@ msgid ""
428428
"assert the mock has been called with the specified calls. The :attr:"
429429
"`mock_calls` list is checked for the calls."
430430
msgstr ""
431-
"斷言 mock 已經使用指定的呼叫所呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的"
431+
"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的"
432432
"呼叫。"
433433

434434
#: ../../library/unittest.mock.rst:365
@@ -444,7 +444,7 @@ msgid ""
444444
"If *any_order* is true then the calls can be in any order, but they must all "
445445
"appear in :attr:`mock_calls`."
446446
msgstr ""
447-
"如果 *any_order* 為 true,那麼這些乎醬可以以任何順序出現,但它們必須全部出現"
447+
"如果 *any_order* 為 true,那麼這些呼叫可以以任何順序出現,但它們必須全部出現"
448448
"在 :attr:`mock_calls` 中。"
449449

450450
#: ../../library/unittest.mock.rst:384

0 commit comments

Comments
 (0)