From d8e1cac8f5c446e82220d38a1bb2737cc6532037 Mon Sep 17 00:00:00 2001 From: Payon Date: Tue, 5 Sep 2023 01:00:38 +0800 Subject: [PATCH 1/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit translate from 212 to 248 --- library/unittest.mock.po | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 35249ae1b7..6248a74ad2 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-08-29 15:33+0800\n" +"PO-Revision-Date: 2023-09-05 00:58+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -198,9 +198,9 @@ msgid "" msgstr "" "為了確保測試中的 mock 物件與它們要替換的物件具有相同的 api,你可以使用\\ :" "ref:`自動規格 `\\ 。自動規格(auto-speccing)可以通過 patch " -"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 " -"mock 物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構" -"函式)都具有與真實物件相同的呼叫簽名(call signature)。" +"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 mock " +"物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構函" +"式)都具有與真實物件相同的呼叫簽名(call signature)。" #: ../../library/unittest.mock.rst:178 msgid "" @@ -229,6 +229,10 @@ msgid "" "attribute will always return the same mock. Mocks record how you use them, " "allowing you to make assertions about what your code has done to them." msgstr "" +":class:`Mock` 是一個彈性的的 mock 物件,旨在代替程式碼中 stubs 和 test " +"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性創建為新" +"的 mock [#]_。存取相同的屬性將永遠返回相同的 mock。Mock 記錄了你如何使用它" +"們,允許你判定你的程式碼對 mock 的行為。" #: ../../library/unittest.mock.rst:218 msgid "" @@ -237,6 +241,9 @@ msgid "" "when you are mocking out objects that aren't callable: :class:" "`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" +":class:`MagicMock` 是 :class:`Mock` 的子類別,其中所有魔術方法均已預先建立並" +"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用:\\ :class:" +"`NonCallableMock` 和 :class:`NonCallableMagicMock`" #: ../../library/unittest.mock.rst:223 msgid "" @@ -245,12 +252,17 @@ msgid "" "will create a :class:`MagicMock` for you. You can specify an alternative " "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" +":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" +"默認情況下,\\ :func:`patch` 會為你建立一個 :class:`MagicMock`\\ 。你可以使" +"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:231 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" +"建立一個新的 :class:`Mock` 對象。\\ :class:`Mock` 接受數個可選的引數來指定 " +"Mock 物件的行為:" #: ../../library/unittest.mock.rst:234 msgid "" @@ -260,6 +272,10 @@ msgid "" "(excluding unsupported magic attributes and methods). Accessing any " "attribute not in this list will raise an :exc:`AttributeError`." msgstr "" +"*spec*:這可以是字串的 list(串列),也可以是充當 mock 物件規格的現有物件(類" +"別或實例)。如果傳入一個物件,則通過對該物件呼叫 dir 來形成字串的串列(不包括" +"不支援的魔術屬性和方法)。存取不在此串列中的任何屬性都會引發 :exc:" +"`AttributeError`\\ 。" #: ../../library/unittest.mock.rst:240 msgid "" @@ -267,6 +283,9 @@ msgid "" "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" +"如果 *spec* 是一個物件(而不是一個字串的串列),那麼 :attr:`~instance." +"__class__` 會回傳 spec 物件的類別。這允許 mocks 通過 :func:`isinstance` 測" +"試。" #: ../../library/unittest.mock.rst:244 msgid "" @@ -274,7 +293,11 @@ msgid "" "get an attribute on the mock that isn't on the object passed as *spec_set* " "will raise an :exc:`AttributeError`." msgstr "" +"*spec_set*:*spec* 的一個更嚴格的變體。如果使用 *spec_set*,在 mock 上嘗試 " +"*set* 或取得不在傳遞給 *spec_set* 的物件上的屬性將會引發 :exc:" +"`AttributeError`。" +# 待討論 #: ../../library/unittest.mock.rst:248 msgid "" "*side_effect*: A function to be called whenever the Mock is called. See the :" @@ -283,6 +306,9 @@ msgid "" "arguments as the mock, and unless it returns :data:`DEFAULT`, the return " "value of this function is used as the return value." msgstr "" +"*side_effect*:每當呼叫 Mock 時要呼叫的函式。參見 :attr:`~Mock.side_effect` " +"屬性。用於引發例外或動態變更回傳值。該函式使用與 mock 相同的引數呼叫,且除非" +"它回傳 :data:`DEFAULT`,否則此函式的返回值將用作返回值。" #: ../../library/unittest.mock.rst:254 msgid "" From b74be573829b1633c9d826d4cf806a135e7943ec Mon Sep 17 00:00:00 2001 From: Payon Date: Thu, 7 Sep 2023 23:26:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit translate from 254 to 369 --- library/unittest.mock.po | 42 +++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 6248a74ad2..58cd965ebb 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-05 00:58+0800\n" +"PO-Revision-Date: 2023-09-07 23:26+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -315,16 +315,20 @@ msgid "" "Alternatively *side_effect* can be an exception class or instance. In this " "case the exception will be raised when the mock is called." msgstr "" +"*side_effect* 也可以是一個例外的類別或實例。在這種情況下,當呼叫 mock 時,該" +"例外將被引發。" #: ../../library/unittest.mock.rst:257 msgid "" "If *side_effect* is an iterable then each call to the mock will return the " "next value from the iterable." msgstr "" +"如果 *side_effect* 是一個可疊代物件,那麼對 mock 的每次呼叫將回傳可疊代物件中" +"的下一個值。" #: ../../library/unittest.mock.rst:260 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "" +msgstr "*side_effect* 可以通過將其設置為 ``None`` 來清除。" #: ../../library/unittest.mock.rst:262 msgid "" @@ -332,6 +336,8 @@ msgid "" "is a new Mock (created on first access). See the :attr:`return_value` " "attribute." msgstr "" +"*return_value*:當呼叫 mock 時回傳的值。默認情況下,這是一個新的 Mock(在首次" +"存取時建立)。參見 :attr:`return_value` 屬性。" #: ../../library/unittest.mock.rst:266 msgid "" @@ -340,6 +346,9 @@ msgid "" "`AttributeError`. Passing ``unsafe=True`` will allow access to these " "attributes." msgstr "" +"*unsafe*:默認情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 " +"*assrt* 開頭的屬性將引發 :exc:`AttributeError`。如果傳遞 ``unsafe=True``\\ ," +"將會允許存取這些屬性。" #: ../../library/unittest.mock.rst:273 msgid "" @@ -350,18 +359,26 @@ msgid "" "to access an attribute that doesn't exist will raise an :exc:" "`AttributeError`)." msgstr "" +"*wraps*:被 mock 物件包裹的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將" +"通過被包裹的物件(返回真實結果)。存取 mock 的屬性將會返回一個 Mock 物件,該" +"物件包裹了被包裹物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:" +"`AttributeError`\\ )。" #: ../../library/unittest.mock.rst:280 msgid "" "If the mock has an explicit *return_value* set then calls are not passed to " "the wrapped object and the *return_value* is returned instead." msgstr "" +"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裹的物件," +"而是回傳已設定好的 *return_value*。" #: ../../library/unittest.mock.rst:283 msgid "" "*name*: If the mock has a name then it will be used in the repr of the mock. " "This can be useful for debugging. The name is propagated to child mocks." msgstr "" +"*name*:如果 mock 有一個名稱,那麼它會被用於 mock 的 repr(表示形式)。這對於" +"除錯很有用。此名稱將被傳播到子 mocks。" #: ../../library/unittest.mock.rst:287 msgid "" @@ -369,30 +386,32 @@ msgid "" "used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" +"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在創建 mock 之後用" +"於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。" #: ../../library/unittest.mock.rst:293 msgid "Assert that the mock was called at least once." -msgstr "" +msgstr "確認 mock 至少被呼叫一次。" #: ../../library/unittest.mock.rst:304 msgid "Assert that the mock was called exactly once." -msgstr "" +msgstr "確認 mock 只被呼叫一次。" #: ../../library/unittest.mock.rst:322 msgid "" "This method is a convenient way of asserting that the last call has been " "made in a particular way:" -msgstr "" +msgstr "這個方法是一個便利的方式,用來斷言最後一次呼叫是以特定方式進行的:" #: ../../library/unittest.mock.rst:332 msgid "" "Assert that the mock was called exactly once and that call was with the " "specified arguments." -msgstr "" +msgstr "確認 mock 只被呼叫一次,且該次呼叫使用了指定的引數。" #: ../../library/unittest.mock.rst:347 msgid "assert the mock has been called with the specified arguments." -msgstr "" +msgstr "斷言 mock 已經被使用指定的引數呼叫。" #: ../../library/unittest.mock.rst:349 msgid "" @@ -401,24 +420,33 @@ msgid "" "the call is the most recent one, and in the case of :meth:" "`assert_called_once_with` it must also be the only call." msgstr "" +"這個斷言在 mock 曾經被呼叫過時通過,不同於 :meth:`assert_called_with` 和 :" +"meth:`assert_called_once_with`,他們針對的是最近的一次的呼叫,而且對於 :meth:" +"`assert_called_once_with`,最近一次的呼叫還必須也是唯一一次的呼叫。" #: ../../library/unittest.mock.rst:362 msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" +"斷言 mock 已經使用指定的呼叫所呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" +"呼叫。" #: ../../library/unittest.mock.rst:365 msgid "" "If *any_order* is false then the calls must be sequential. There can be " "extra calls before or after the specified calls." msgstr "" +"如果 *any_order* 為 false,那麼這些呼叫必須按照順序。在指定的呼叫之前或之後可" +"以有額外的呼叫。" #: ../../library/unittest.mock.rst:369 msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" +"如果 *any_order* 為 true,那麼這些乎醬可以以任何順序出現,但它們必須全部出現" +"在 :attr:`mock_calls` 中。" #: ../../library/unittest.mock.rst:384 msgid "Assert the mock was never called." From 537fc3b77ed39462e8e703d212966e2b660d513d Mon Sep 17 00:00:00 2001 From: Payon Date: Thu, 7 Sep 2023 23:32:40 +0800 Subject: [PATCH 3/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove comment --- library/unittest.mock.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 58cd965ebb..d6edf1a1e6 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-07 23:26+0800\n" +"PO-Revision-Date: 2023-09-07 23:32+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -297,7 +297,6 @@ msgstr "" "*set* 或取得不在傳遞給 *spec_set* 的物件上的屬性將會引發 :exc:" "`AttributeError`。" -# 待討論 #: ../../library/unittest.mock.rst:248 msgid "" "*side_effect*: A function to be called whenever the Mock is called. See the :" From d064ad3d0ccac79d7428bd02ad975991b82a818c Mon Sep 17 00:00:00 2001 From: Payon Date: Thu, 7 Sep 2023 23:34:40 +0800 Subject: [PATCH 4/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正用詞 --- library/unittest.mock.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index d6edf1a1e6..f6b84fa044 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-07 23:32+0800\n" +"PO-Revision-Date: 2023-09-07 23:34+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -307,7 +307,7 @@ msgid "" msgstr "" "*side_effect*:每當呼叫 Mock 時要呼叫的函式。參見 :attr:`~Mock.side_effect` " "屬性。用於引發例外或動態變更回傳值。該函式使用與 mock 相同的引數呼叫,且除非" -"它回傳 :data:`DEFAULT`,否則此函式的返回值將用作返回值。" +"它回傳 :data:`DEFAULT`,否則此函式的回傳值將用作回傳值。" #: ../../library/unittest.mock.rst:254 msgid "" From 48b8e319611b0aaf36263e88935caa9d18d71e85 Mon Sep 17 00:00:00 2001 From: Payon Date: Sat, 9 Sep 2023 23:08:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根據review修正 --- library/unittest.mock.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index f6b84fa044..22dae8bc48 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-07 23:34+0800\n" +"PO-Revision-Date: 2023-09-09 23:07+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -305,8 +305,8 @@ msgid "" "arguments as the mock, and unless it returns :data:`DEFAULT`, the return " "value of this function is used as the return value." msgstr "" -"*side_effect*:每當呼叫 Mock 時要呼叫的函式。參見 :attr:`~Mock.side_effect` " -"屬性。用於引發例外或動態變更回傳值。該函式使用與 mock 相同的引數呼叫,且除非" +"*side_effect*:每當呼叫 Mock 時要呼叫的函式,參見 :attr:`~Mock.side_effect` " +"屬性,用於引發例外或動態變更回傳值。該函式使用與 mock 相同的引數呼叫,且除非" "它回傳 :data:`DEFAULT`,否則此函式的回傳值將用作回傳值。" #: ../../library/unittest.mock.rst:254 @@ -376,8 +376,8 @@ msgid "" "*name*: If the mock has a name then it will be used in the repr of the mock. " "This can be useful for debugging. The name is propagated to child mocks." msgstr "" -"*name*:如果 mock 有一個名稱,那麼它會被用於 mock 的 repr(表示形式)。這對於" -"除錯很有用。此名稱將被傳播到子 mocks。" +"*name*:如果 mock 有一個名稱,那麼它會被用於 mock 的 repr。這對於除錯很有用。" +"此名稱將被傳播到子 mocks。" #: ../../library/unittest.mock.rst:287 msgid "" From e1311dec385ac883344f5d3ff9b37bfabe10c99e Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 11 Sep 2023 19:02:51 +0800 Subject: [PATCH 6/6] =?UTF-8?q?docs:=20mock=20=E7=BF=BB=E8=AD=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根據review修正 --- library/unittest.mock.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 22dae8bc48..8067ed10cc 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -230,8 +230,8 @@ msgid "" "allowing you to make assertions about what your code has done to them." msgstr "" ":class:`Mock` 是一個彈性的的 mock 物件,旨在代替程式碼中 stubs 和 test " -"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性創建為新" -"的 mock [#]_。存取相同的屬性將永遠返回相同的 mock。Mock 記錄了你如何使用它" +"doubles (測試替身)的使用。Mock 是可呼叫的,並在你存取它們時將屬性建立為新" +"的 mock [#]_。存取相同的屬性將永遠回傳相同的 mock。Mock 記錄了你如何使用它" "們,允許你判定你的程式碼對 mock 的行為。" #: ../../library/unittest.mock.rst:218 @@ -242,7 +242,7 @@ msgid "" "`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" ":class:`MagicMock` 是 :class:`Mock` 的子類別,其中所有魔術方法均已預先建立並" -"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用:\\ :class:" +"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用::class:" "`NonCallableMock` 和 :class:`NonCallableMagicMock`" #: ../../library/unittest.mock.rst:223 @@ -253,7 +253,7 @@ msgid "" "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" ":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" -"默認情況下,\\ :func:`patch` 會為你建立一個 :class:`MagicMock`\\ 。你可以使" +"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使" "用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:231 @@ -261,7 +261,7 @@ msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" -"建立一個新的 :class:`Mock` 對象。\\ :class:`Mock` 接受數個可選的引數來指定 " +"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 " "Mock 物件的行為:" #: ../../library/unittest.mock.rst:234 @@ -335,7 +335,7 @@ msgid "" "is a new Mock (created on first access). See the :attr:`return_value` " "attribute." msgstr "" -"*return_value*:當呼叫 mock 時回傳的值。默認情況下,這是一個新的 Mock(在首次" +"*return_value*:當呼叫 mock 時回傳的值。預設情況下,這是一個新的 Mock(在首次" "存取時建立)。參見 :attr:`return_value` 屬性。" #: ../../library/unittest.mock.rst:266 @@ -345,7 +345,7 @@ msgid "" "`AttributeError`. Passing ``unsafe=True`` will allow access to these " "attributes." msgstr "" -"*unsafe*:默認情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 " +"*unsafe*:預設情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 " "*assrt* 開頭的屬性將引發 :exc:`AttributeError`。如果傳遞 ``unsafe=True``\\ ," "將會允許存取這些屬性。" @@ -358,9 +358,9 @@ msgid "" "to access an attribute that doesn't exist will raise an :exc:" "`AttributeError`)." msgstr "" -"*wraps*:被 mock 物件包裹的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將" -"通過被包裹的物件(返回真實結果)。存取 mock 的屬性將會返回一個 Mock 物件,該" -"物件包裹了被包裹物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:" +"*wraps*:被 mock 物件包裝的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將" +"通過被包裝的物件(回傳真實結果)。存取 mock 的屬性將會回傳一個 Mock 物件,該" +"物件包裝了被包裝物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:" "`AttributeError`\\ )。" #: ../../library/unittest.mock.rst:280 @@ -368,7 +368,7 @@ msgid "" "If the mock has an explicit *return_value* set then calls are not passed to " "the wrapped object and the *return_value* is returned instead." msgstr "" -"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裹的物件," +"如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裝的物件," "而是回傳已設定好的 *return_value*。" #: ../../library/unittest.mock.rst:283 @@ -385,7 +385,7 @@ msgid "" "used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" -"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在創建 mock 之後用" +"Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在建立 mock 之後用" "於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。" #: ../../library/unittest.mock.rst:293 @@ -428,7 +428,7 @@ msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"斷言 mock 已經使用指定的呼叫所呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" +"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" "呼叫。" #: ../../library/unittest.mock.rst:365 @@ -444,7 +444,7 @@ msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" -"如果 *any_order* 為 true,那麼這些乎醬可以以任何順序出現,但它們必須全部出現" +"如果 *any_order* 為 true,那麼這些呼叫可以以任何順序出現,但它們必須全部出現" "在 :attr:`mock_calls` 中。" #: ../../library/unittest.mock.rst:384