8000 docs: 翻譯至rst:59 · python/python-docs-zh-tw@81ed61c · GitHub
[go: up one dir, main page]

Skip to content

Commit 81ed61c

Browse files
committed
docs: 翻譯至rst:59
1 parent 3214269 commit 81ed61c

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

library/unittest.mock-examples.po

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2023-09-09 00:03+0000\n"
11-
"PO-Revision-Date: 2016-11-19 00:35+0000\n"
11+
"PO-Revision-Date: 2023-11-03 00:14+0800\n"
1212
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1414
"tw)\n"
@@ -17,49 +17,56 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=1; plural=0;\n"
20+
"X-Generator: Poedit 3.4\n"
2021

2122
#: ../../library/unittest.mock-examples.rst:2
2223
msgid ":mod:`unittest.mock` --- getting started"
23-
msgstr ""
24+
msgstr ":mod:`unittest.mock` --- 入門指南"
2425

2526
#: ../../library/unittest.mock-examples.rst:27
2627
msgid "Using Mock"
27-
msgstr ""
28+
msgstr "使用 Mock 的方式"
2829

2930
#: ../../library/unittest.mock-examples.rst:30
3031
msgid "Mock Patching Methods"
31-
msgstr ""
32+
msgstr "使用 Mock 來 patching methods(方法)"
3233

3334
#: ../../library/unittest.mock-examples.rst:32
3435
msgid "Common uses for :class:`Mock` objects include:"
35-
msgstr ""
36+
msgstr ":class:`Mock` 物件的常見用法包含:"
3637

3738
#: ../../library/unittest.mock-examples.rst:34
3839
msgid "Patching methods"
39-
msgstr ""
40+
msgstr "Patching 方法"
4041

4142
#: ../../library/unittest.mock-examples.rst:35
4243
msgid "Recording method calls on objects"
43-
msgstr ""
44+
msgstr "記錄在物件上的方法呼叫"
4445

4546
#: ../../library/unittest.mock-examples.rst:37
4647
msgid ""
4748
"You might want to replace a method on an object to check that it is called "
4849
"with the correct arguments by another part of the system:"
4950
msgstr ""
51+
"你可能會想要取代一個物件上的方法,以便檢查系統的另一部分是否使用正確的引數呼"
52+
"叫它:"
5053

5154
#: ../../library/unittest.mock-examples.rst:45
5255
msgid ""
5356
"Once our mock has been used (``real.method`` in this example) it has methods "
5457
"and attributes that allow you to make assertions about how it has been used."
5558
msgstr ""
59+
"一旦我們的 mock 已經被使用(例如在這個範例中的 ``real.method``),它就有了方"
60+
"法和屬性,允許你對其使用方式進行 assertions (斷言)。"
5661

5762
#: ../../library/unittest.mock-examples.rst:50
5863
msgid ""
5964
"In most of these examples the :class:`Mock` and :class:`MagicMock` classes "
6065
"are interchangeable. As the ``MagicMock`` is the more capable class it makes "
6166
"a sensible one to use by default."
6267
msgstr ""
68+
"在大多數的範例中,:class:`Mock` 和 :class:`MagicMock` class(類別)是可以互換"
69+
"的。不過由於 ``MagicMock`` 是功能更強大的類別,因此通常它是一個更好的選擇。"
6370

6471
#: ../../library/unittest.mock-examples.rst:54
6572
msgid ""
@@ -68,12 +75,17 @@ msgid ""
6875
"or :meth:`~Mock.assert_called_once_with` method to check that it was called "
6976
"with the correct arguments."
7077
msgstr ""
78+
"一旦 mock 被呼叫,它的 :attr:`~Mock.called` 屬性將被設定為 ``True``。更重要的"
79+
"是,我們可以使用 :meth:`~Mock.assert_called_with` 或 :meth:`~Mock."
80+
"assert_called_once_with` 方法來檢查它是否被使用正確的引數來呼叫。"
7181

7282
#: ../../library/unittest.mock-examples.rst:59
7383
msgid ""
7484
"This example tests that calling ``ProductionClass().method`` results in a "
7585
"call to the ``something`` method:"
7686
msgstr ""
87+
"這個範例測試呼叫 ``ProductionClass().method`` 是否導致對 ``something`` 方法的"
88+
"呼叫:"
7789

7890
#: ../../library/unittest.mock-examples.rst:76
7991
msgid "Mock for Method Calls on an Object"

0 commit comments

Comments
 (0)
0