@@ -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-1900:14 +0800\n "
10
+ "PO-Revision-Date :2024-01-1923:45 +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 "
@@ -1547,76 +1547,87 @@ msgstr "patch.dict"
1547
1547
msgid ""
1548
1548
"Patch a dictionary, or dictionary like object, and restore the dictionary to "
1549
1549
"its original state after the test."
1550
- msgstr ""
1550
+ msgstr "Patch 字典或類字典的物件,並在測試後將字典回復到其原本的狀態。 "
1551
1551
1552
1552
#: ../../library/unittest.mock.rst:1581
1553
1553
msgid ""
1554
1554
"*in_dict* can be a dictionary or a mapping like container. If it is a "
1555
1555
"mapping then it must at least support getting, setting and deleting items "
1556
1556
"plus iterating over keys."
1557
1557
msgstr ""
1558
+ "*in_dict* 可以是一個字典或一個類對映的容器。如果它是一個對映,那麼它至少必須"
1559
+ "支援獲取、設定、刪除項目以及對鍵的疊代。"
1558
1560
1559
1561
#: ../../library/unittest.mock.rst:1585
1560
1562
msgid ""
1561
1563
"*in_dict* can also be a string specifying the name of the dictionary, which "
1562
1564
"will then be fetched by importing it."
1563
- msgstr ""
1565
+ msgstr "*in_dict* 也可以是指定字典名稱的字串,然後透過 import 來取得該字典。 "
1564
1566
1565
1567
#: ../../library/unittest.mock.rst:1588
1566
1568
msgid ""
1567
1569
"*values* can be a dictionary of values to set in the dictionary. *values* "
1568
1570
"can also be an iterable of ``(key, value)`` pairs."
1569
1571
msgstr ""
1572
+ "*values* 可以是要設定的值的字典。*values* 也可以是 ``(key, value)`` 對 "
1573
+ "(pairs) 的可疊代物件。"
1570
1574
1571
1575
#: ../../library/unittest.mock.rst:1591
1572
1576
msgid ""
1573
1577
"If *clear* is true then the dictionary will be cleared before the new values "
1574
1578
"are set."
1575
- msgstr ""
1579
+ msgstr "如果 *clear* 為 true,則在設定新值之前字典將被清除。 "
1576
1580
1577
1581
#: ../../library/unittest.mock.rst:1594
1578
1582
msgid ""
1579
1583
":func:`patch.dict` can also be called with arbitrary keyword arguments to "
1580
1584
"set values in the dictionary."
1581
- msgstr ""
1585
+ msgstr "也可以使用任意關鍵字引數呼叫 :func:`patch.dict` 以在字典中設定值。 "
1582
1586
1583
1587
#: ../../library/unittest.mock.rst:1599
1584
1588
msgid ""
1585
1589
":func:`patch.dict` now returns the patched dictionary when used as a context "
1586
1590
"manager."
1587
- msgstr ""
1591
+ msgstr ":func:`patch.dict` 現在在做為情境管理器使用時回傳被 patch 的字典。 "
1588
1592
1589
1593
#: ../../library/unittest.mock.rst:1602
1590
1594
msgid ""
1591
1595
":func:`patch.dict` can be used as a context manager, decorator or class "
1592
1596
"decorator:"
1593
- msgstr ""
1597
+ msgstr ":func:`patch.dict` 可以做為情境管理器、裝飾器或類別裝飾器使用: "
1594
1598
1595
1599
#: ../../library/unittest.mock.rst:1613
1596
1600
msgid ""
1597
1601
"When used as a class decorator :func:`patch.dict` honours ``patch."
1598
1602
"TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:"
1599
1603
msgstr ""
1604
+ "當作為類別裝飾器使用時,:func:`patch.dict` 會遵循 ``patch.TEST_PREFIX``/ (預"
1605
+ "設為 ``'test'``/ )來選擇要包裝的方法:"
1600
1606
1601
1607
#: ../../library/unittest.mock.rst:1624
1602
1608
msgid ""
1603
1609
"If you want to use a different prefix for your test, you can inform the "
1604
1610
"patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more "
1605
1611
"details about how to change the value of see :ref:`test-prefix`."
1606
1612
msgstr ""
1613
+ "如果你想在測試中使用不同的前綴,你可以透過設定 ``patch.TEST_PREFIX`` 來告知 "
1614
+ "patch 使用不同的前綴。請參閱 :ref:`test-prefix` 以得知如何修改前綴的更多內"
1615
+ "容。"
1607
1616
1608
1617
#: ../../library/unittest.mock.rst:1628
1609
1618
msgid ""
1610
1619
":func:`patch.dict` can be used to add members to a dictionary, or simply let "
1611
1620
"a test change a dictionary, and ensure the dictionary is restored when the "
1612
1621
"test ends."
1613
1622
msgstr ""
1623
+ ":func:`patch.dict` 可用於在字典中新增成員,或單純地讓測試更改字典,並確保在測"
1624
+ "試結束時將字典回復原狀。"
1614
1625
1615
1626
#: ../../library/unittest.mock.rst:1649
1616
1627
msgid ""
1617
1628
"Keywords can be used in the :func:`patch.dict` call to set values in the "
1618
1629
"dictionary:"
1619
- msgstr ""
1630
+ msgstr "可以在 :func:`patch.dict` 呼叫中使用關鍵字來設定字典中的值: "
1620
1631
1621
1632
#: ../../library/unittest.mock.rst:1659
1622
1633
msgid ""
@@ -1627,6 +1638,11 @@ msgid ""
1627
1638
"__setitem__`, :meth:`~object.__delitem__` and either :meth:`~container."
1628
1639
"__iter__` or :meth:`~object.__contains__`."
1629
1640
msgstr ""
1641
+ ":func:`patch.dict` 可以與實際上不是字典的類字典物件一起使用。最低限度它們必須"
1642
+ "支援項目的獲取、設定、刪除以及疊代或隸屬資格測試。這對應到魔術方法中的 :meth:"
1643
+ "`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object."
1644
+ "__delitem__` 以及 :meth:`~container.__iter__` 或 :meth: `~ object."
1645
+ "__contains__`。"
1630
1646
1631
1647
#: ../../library/unittest.mock.rst:1689
1632
1648
msgid "patch.multiple"