Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0e9bb7

Browse files
committed
feat: to rst:1659
1 parent3da9ae9 commitf0e9bb7

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

‎library/unittest.mock.po

Lines changed: 24 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-1900:14+0800\n"
10+
"PO-Revision-Date:2024-01-1923:45+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"
@@ -1547,76 +1547,87 @@ msgstr "patch.dict"
15471547
msgid""
15481548
"Patch a dictionary, or dictionary like object, and restore the dictionary to "
15491549
"its original state after the test."
1550-
msgstr""
1550+
msgstr"Patch 字典或類字典的物件,並在測試後將字典回復到其原本的狀態。"
15511551

15521552
#:../../library/unittest.mock.rst:1581
15531553
msgid""
15541554
"*in_dict* can be a dictionary or a mapping like container. If it is a "
15551555
"mapping then it must at least support getting, setting and deleting items "
15561556
"plus iterating over keys."
15571557
msgstr""
1558+
"*in_dict* 可以是一個字典或一個類對映的容器。如果它是一個對映,那麼它至少必須"
1559+
"支援獲取、設定、刪除項目以及對鍵的疊代。"
15581560

15591561
#:../../library/unittest.mock.rst:1585
15601562
msgid""
15611563
"*in_dict* can also be a string specifying the name of the dictionary, which "
15621564
"will then be fetched by importing it."
1563-
msgstr""
1565+
msgstr"*in_dict* 也可以是指定字典名稱的字串,然後透過 import 來取得該字典。"
15641566

15651567
#:../../library/unittest.mock.rst:1588
15661568
msgid""
15671569
"*values* can be a dictionary of values to set in the dictionary. *values* "
15681570
"can also be an iterable of ``(key, value)`` pairs."
15691571
msgstr""
1572+
"*values* 可以是要設定的值的字典。*values* 也可以是 ``(key, value)`` 對 "
1573+
"(pairs) 的可疊代物件。"
15701574

15711575
#:../../library/unittest.mock.rst:1591
15721576
msgid""
15731577
"If *clear* is true then the dictionary will be cleared before the new values "
15741578
"are set."
1575-
msgstr""
1579+
msgstr"如果 *clear* 為 true,則在設定新值之前字典將被清除。"
15761580

15771581
#:../../library/unittest.mock.rst:1594
15781582
msgid""
15791583
":func:`patch.dict` can also be called with arbitrary keyword arguments to "
15801584
"set values in the dictionary."
1581-
msgstr""
1585+
msgstr"也可以使用任意關鍵字引數呼叫 :func:`patch.dict` 以在字典中設定值。"
15821586

15831587
#:../../library/unittest.mock.rst:1599
15841588
msgid""
15851589
":func:`patch.dict` now returns the patched dictionary when used as a context "
15861590
"manager."
1587-
msgstr""
1591+
msgstr":func:`patch.dict` 現在在做為情境管理器使用時回傳被 patch 的字典。"
15881592

15891593
#:../../library/unittest.mock.rst:1602
15901594
msgid""
15911595
":func:`patch.dict` can be used as a context manager, decorator or class "
15921596
"decorator:"
1593-
msgstr""
1597+
msgstr":func:`patch.dict` 可以做為情境管理器、裝飾器或類別裝飾器使用:"
15941598

15951599
#:../../library/unittest.mock.rst:1613
15961600
msgid""
15971601
"When used as a class decorator :func:`patch.dict` honours ``patch."
15981602
"TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:"
15991603
msgstr""
1604+
"當作為類別裝飾器使用時,:func:`patch.dict` 會遵循 ``patch.TEST_PREFIX``/ (預"
1605+
"設為 ``'test'``/ )來選擇要包裝的方法:"
16001606

16011607
#:../../library/unittest.mock.rst:1624
16021608
msgid""
16031609
"If you want to use a different prefix for your test, you can inform the "
16041610
"patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more "
16051611
"details about how to change the value of see :ref:`test-prefix`."
16061612
msgstr""
1613+
"如果你想在測試中使用不同的前綴,你可以透過設定 ``patch.TEST_PREFIX`` 來告知 "
1614+
"patch 使用不同的前綴。請參閱 :ref:`test-prefix` 以得知如何修改前綴的更多內"
1615+
"容。"
16071616

16081617
#:../../library/unittest.mock.rst:1628
16091618
msgid""
16101619
":func:`patch.dict` can be used to add members to a dictionary, or simply let "
16111620
"a test change a dictionary, and ensure the dictionary is restored when the "
16121621
"test ends."
16131622
msgstr""
1623+
":func:`patch.dict` 可用於在字典中新增成員,或單純地讓測試更改字典,並確保在測"
1624+
"試結束時將字典回復原狀。"
16141625

16151626
#:../../library/unittest.mock.rst:1649
16161627
msgid""
16171628
"Keywords can be used in the :func:`patch.dict` call to set values in the "
16181629
"dictionary:"
1619-
msgstr""
1630+
msgstr"可以在 :func:`patch.dict` 呼叫中使用關鍵字來設定字典中的值:"
16201631

16211632
#:../../library/unittest.mock.rst:1659
16221633
msgid""
@@ -1627,6 +1638,11 @@ msgid ""
16271638
"__setitem__`, :meth:`~object.__delitem__` and either :meth:`~container."
16281639
"__iter__` or :meth:`~object.__contains__`."
16291640
msgstr""
1641+
":func:`patch.dict` 可以與實際上不是字典的類字典物件一起使用。最低限度它們必須"
1642+
"支援項目的獲取、設定、刪除以及疊代或隸屬資格測試。這對應到魔術方法中的 :meth:"
1643+
"`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object."
1644+
"__delitem__` 以及 :meth:`~container.__iter__` 或 :meth: `~ object."
1645+
"__contains__`。"
16301646

16311647
#:../../library/unittest.mock.rst:1689
16321648
msgid"patch.multiple"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp