Skip to content

Commit c3ede4a

Browse files
committed
feat: to rst:1753
1 parent f0e9bb7 commit c3ede4a

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

library/unittest.mock.po

Lines changed: 26 additions & 8 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-19 23:45+0800\n"
10+
"PO-Revision-Date: 2024-01-20 00:21+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"
@@ -1501,9 +1501,9 @@ msgid ""
15011501
"configuring the mock object it creates."
15021502
msgstr ""
15031503
":func:`patch.object` 可以做為裝飾器、類別裝飾器或情境管理器使用。引數 *new*、"
1504-
"*spec*、*create*、*spec_set*、*autospec* 和 *new_callable* :func:`patch` "
1505-
"具有相同的意義。與 :func:`patch` 一樣,:func:`patch.object` 接受任意關鍵字引"
1506-
"數來配置它所建立的 mock 物件。"
1504+
"*spec*、*create*、*spec_set*、*autospec* 和 *new_callable* 與在 :func:"
1505+
"`patch` 中的引數具有相同的意義。與 :func:`patch` 一樣,:func:`patch.object` "
1506+
"接受任意關鍵字引數來配置它所建立的 mock 物件。"
15071507

15081508
#: ../../library/unittest.mock.rst:1551
15091509
msgid ""
@@ -1536,8 +1536,8 @@ msgid ""
15361536
"*spec*, *create* and the other arguments to :func:`patch.object` have the "
15371537
"same meaning as they do for :func:`patch`."
15381538
msgstr ""
1539-
"*spec*、*create* 和 :func:`patch.object` 的其他引數與 :func:`patch` 具有相同"
1540-
"的意義。"
1539+
"*spec*、*create* 和 :func:`patch.object` 的其他引數與在 :func:`patch` 中的引"
1540+
"數具有相同的意義。"
15411541

15421542
#: ../../library/unittest.mock.rst:1574
15431543
msgid "patch.dict"
@@ -1641,7 +1641,7 @@ msgstr ""
16411641
":func:`patch.dict` 可以與實際上不是字典的類字典物件一起使用。最低限度它們必須"
16421642
"支援項目的獲取、設定、刪除以及疊代或隸屬資格測試。這對應到魔術方法中的 :meth:"
16431643
"`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object."
1644-
"__delitem__` 以及 :meth:`~container.__iter__` 或 :meth: `~ object."
1644+
"__delitem__` 以及 :meth:`~container.__iter__` 或 :meth:`~object."
16451645
"__contains__`。"
16461646

16471647
#: ../../library/unittest.mock.rst:1689
@@ -1654,6 +1654,8 @@ msgid ""
16541654
"(either as an object or a string to fetch the object by importing) and "
16551655
"keyword arguments for the patches::"
16561656
msgstr ""
1657+
"在一次呼叫中執行多個 patch。它接受被 patch 的物件(作為物件或透過 import 取得"
1658+
"物件的字串)和 patch 的關鍵字引數: ::"
16571659

16581660
#: ../../library/unittest.mock.rst:1700
16591661
msgid ""
@@ -1662,6 +1664,9 @@ msgid ""
16621664
"decorated function by keyword, and a dictionary is returned when :func:"
16631665
"`patch.multiple` is used as a context manager."
16641666
msgstr ""
1667+
"如果你想要 :func:`patch.multiple` 為你建立 mock,請使用 :data:`DEFAULT` 作為"
1668+
"值。在這種情況下,被建立的 mock 會透過關鍵字傳遞到被裝飾的函式中,並且當 :"
1669+
"func:`patch.multiple` 作為情境管理器時會回傳字典。"
16651670

16661671
#: ../../library/unittest.mock.rst:1705
16671672
msgid ""
@@ -1670,12 +1675,18 @@ msgid ""
16701675
"*new_callable* have the same meaning as for :func:`patch`. These arguments "
16711676
"will be applied to *all* patches done by :func:`patch.multiple`."
16721677
msgstr ""
1678+
":func:`patch.multiple` 可以做為裝飾器、類別裝飾器或情境管理器使用。引數 "
1679+
"*spec*、*spec_set*、*create*、*autospec* 和 *new_callable* 與在 :func:"
1680+
"`patch` 中的引數具有相同的意義。這些引數將應用於由 :func:`patch.multiple` 完"
1681+
"成的/ *所有* patch。"
16731682

16741683
#: ../../library/unittest.mock.rst:1710
16751684
msgid ""
16761685
"When used as a class decorator :func:`patch.multiple` honours ``patch."
16771686
"TEST_PREFIX`` for choosing which methods to wrap."
16781687
msgstr ""
1688+
"當作為類別裝飾器使用時,:func:`patch.multiple` 遵循 ``patch.TEST_PREFIX`` 來"
1689+
"選擇要包裝的方法。"
16791690

16801691
#: ../../library/unittest.mock.rst:1713
16811692
msgid ""
@@ -1684,24 +1695,31 @@ msgid ""
16841695
"decorator then the created mocks are passed into the decorated function by "
16851696
"keyword. ::"
16861697
msgstr ""
1698+
"如果你想要 :func:`patch.multiple`為你建立 mock,那麼你可以使用 :data:"
1699+
"`DEFAULT` 作為值。如果你使用 :func:`patch.multiple` 作為裝飾器,那麼被建立的 "
1700+
"mock 將透過關鍵字傳遞到被裝飾的函式中。: ::"
16871701

16881702
#: ../../library/unittest.mock.rst:1727
16891703
msgid ""
16901704
":func:`patch.multiple` can be nested with other ``patch`` decorators, but "
16911705
"put arguments passed by keyword *after* any of the standard arguments "
16921706
"created by :func:`patch`::"
16931707
msgstr ""
1708+
":func:`patch.multiple` 可以與其他 ``patch`` 裝飾器嵌套,但需要將透過關鍵字傳"
1709+
"遞的引數放在 :func:`patch` 建立的任何標準引數/ *之後*/ : ::"
16941710

16951711
#: ../../library/unittest.mock.rst:1739
16961712
msgid ""
16971713
"If :func:`patch.multiple` is used as a context manager, the value returned "
16981714
"by the context manager is a dictionary where created mocks are keyed by "
16991715
"name::"
17001716
msgstr ""
1717+
"如果 :func:`patch.multiple` 作為情境管理器使用,則情境管理器回傳的值是一個字"
1718+
"典,其中被建立的 mock 會按名稱作為其鍵值: ::"
17011719

17021720
#: ../../library/unittest.mock.rst:1753
17031721
msgid "patch methods: start and stop"
1704-
msgstr ""
1722+
msgstr "patch 方法:啟動與停止"
17051723

17061724
#: ../../library/unittest.mock.rst:1755
17071725
msgid ""

0 commit comments

Comments
 (0)