@@ -7,7 +7,7 @@ msgstr ""
7
7
"Project-Id-Version :Python 3.12\n "
8
8
"Report-Msgid-Bugs-To :\n "
9
9
"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 "
11
11
"Last-Translator :Adrian Liaw <adrianliaw2000@gmail.com>\n "
12
12
"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
13
13
"tw)\n "
@@ -1501,9 +1501,9 @@ msgid ""
1501
1501
"configuring the mock object it creates."
1502
1502
msgstr ""
1503
1503
":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 物件。"
1507
1507
1508
1508
#: ../../library/unittest.mock.rst:1551
1509
1509
msgid ""
@@ -1536,8 +1536,8 @@ msgid ""
1536
1536
"*spec*, *create* and the other arguments to :func:`patch.object` have the "
1537
1537
"same meaning as they do for :func:`patch`."
1538
1538
msgstr ""
1539
- "*spec*、*create* 和 :func:`patch.object`的其他引數與 :func:`patch`具有相同 "
1540
- "的意義 。"
1539
+ "*spec*、*create* 和 :func:`patch.object`的其他引數與在 :func:`patch`中的引 "
1540
+ "數具有相同的意義 。"
1541
1541
1542
1542
#: ../../library/unittest.mock.rst:1574
1543
1543
msgid "patch.dict"
@@ -1641,7 +1641,7 @@ msgstr ""
1641
1641
":func:`patch.dict` 可以與實際上不是字典的類字典物件一起使用。最低限度它們必須"
1642
1642
"支援項目的獲取、設定、刪除以及疊代或隸屬資格測試。這對應到魔術方法中的 :meth:"
1643
1643
"`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object."
1644
- "__delitem__` 以及 :meth:`~container.__iter__` 或 :meth: `~ object."
1644
+ "__delitem__` 以及 :meth:`~container.__iter__` 或 :meth:`~ object."
1645
1645
"__contains__`。"
1646
1646
1647
1647
#: ../../library/unittest.mock.rst:1689
@@ -1654,6 +1654,8 @@ msgid ""
1654
1654
"(either as an object or a string to fetch the object by importing) and "
1655
1655
"keyword arguments for the patches::"
1656
1656
msgstr ""
1657
+ "在一次呼叫中執行多個 patch。它接受被 patch 的物件(作為物件或透過 import 取得"
1658
+ "物件的字串)和 patch 的關鍵字引數: ::"
1657
1659
1658
1660
#: ../../library/unittest.mock.rst:1700
1659
1661
msgid ""
@@ -1662,6 +1664,9 @@ msgid ""
1662
1664
"decorated function by keyword, and a dictionary is returned when :func:"
1663
1665
"`patch.multiple` is used as a context manager."
1664
1666
msgstr ""
1667
+ "如果你想要 :func:`patch.multiple` 為你建立 mock,請使用 :data:`DEFAULT` 作為"
1668
+ "值。在這種情況下,被建立的 mock 會透過關鍵字傳遞到被裝飾的函式中,並且當 :"
1669
+ "func:`patch.multiple` 作為情境管理器時會回傳字典。"
1665
1670
1666
1671
#: ../../library/unittest.mock.rst:1705
1667
1672
msgid ""
@@ -1670,12 +1675,18 @@ msgid ""
1670
1675
"*new_callable* have the same meaning as for :func:`patch`. These arguments "
1671
1676
"will be applied to *all* patches done by :func:`patch.multiple`."
1672
1677
msgstr ""
1678
+ ":func:`patch.multiple` 可以做為裝飾器、類別裝飾器或情境管理器使用。引數 "
1679
+ "*spec*、*spec_set*、*create*、*autospec* 和 *new_callable* 與在 :func:"
1680
+ "`patch` 中的引數具有相同的意義。這些引數將應用於由 :func:`patch.multiple` 完"
1681
+ "成的/ *所有* patch。"
1673
1682
1674
1683
#: ../../library/unittest.mock.rst:1710
1675
1684
msgid ""
1676
1685
"When used as a class decorator :func:`patch.multiple` honours ``patch."
1677
1686
"TEST_PREFIX`` for choosing which methods to wrap."
1678
1687
msgstr ""
1688
+ "當作為類別裝飾器使用時,:func:`patch.multiple` 遵循 ``patch.TEST_PREFIX`` 來"
1689
+ "選擇要包裝的方法。"
1679
1690
1680
1691
#: ../../library/unittest.mock.rst:1713
1681
1692
msgid ""
@@ -1684,24 +1695,31 @@ msgid ""
1684
1695
"decorator then the created mocks are passed into the decorated function by "
1685
1696
"keyword. ::"
1686
1697
msgstr ""
1698
+ "如果你想要 :func:`patch.multiple`為你建立 mock,那麼你可以使用 :data:"
1699
+ "`DEFAULT` 作為值。如果你使用 :func:`patch.multiple` 作為裝飾器,那麼被建立的 "
1700
+ "mock 將透過關鍵字傳遞到被裝飾的函式中。: ::"
1687
1701
1688
1702
#: ../../library/unittest.mock.rst:1727
1689
1703
msgid ""
1690
1704
":func:`patch.multiple` can be nested with other ``patch`` decorators, but "
1691
1705
"put arguments passed by keyword *after* any of the standard arguments "
1692
1706
"created by :func:`patch`::"
1693
1707
msgstr ""
1708
+ ":func:`patch.multiple` 可以與其他 ``patch`` 裝飾器嵌套,但需要將透過關鍵字傳"
1709
+ "遞的引數放在 :func:`patch` 建立的任何標準引數/ *之後*/ : ::"
1694
1710
1695
1711
#: ../../library/unittest.mock.rst:1739
1696
1712
msgid ""
1697
1713
"If :func:`patch.multiple` is used as a context manager, the value returned "
1698
1714
"by the context manager is a dictionary where created mocks are keyed by "
1699
1715
"name::"
1700
1716
msgstr ""
1717
+ "如果 :func:`patch.multiple` 作為情境管理器使用,則情境管理器回傳的值是一個字"
1718
+ "典,其中被建立的 mock 會按名稱作為其鍵值: ::"
1701
1719
1702
1720
#: ../../library/unittest.mock.rst:1753
1703
1721
msgid "patch methods: start and stop"
1704
- msgstr ""
1722
+ msgstr "patch 方法:啟動與停止 "
1705
1723
1706
1724
#: ../../library/unittest.mock.rst:1755
1707
1725
msgid ""