@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"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 "
12
12
"Last-Translator : Liang-Bo Wang <me@liang2.tw>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -17,49 +17,56 @@ msgstr ""
17
17
"Content-Type : text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding : 8bit\n "
19
19
"Plural-Forms : nplurals=1; plural=0;\n "
20
+ "X-Generator : Poedit 3.4\n "
20
21
21
22
#: ../../library/unittest.mock-examples.rst:2
22
23
msgid ":mod:`unittest.mock` --- getting started"
23
- msgstr ""
24
+ msgstr ":mod:`unittest.mock` --- 入門指南 "
24
25
25
26
#: ../../library/unittest.mock-examples.rst:27
26
27
msgid "Using Mock"
27
- msgstr ""
28
+ msgstr "使用 Mock 的方式 "
28
29
29
30
#: ../../library/unittest.mock-examples.rst:30
30
31
msgid "Mock Patching Methods"
31
- msgstr ""
32
+ msgstr "使用 Mock 來 patching methods(方法) "
32
33
33
34
#: ../../library/unittest.mock-examples.rst:32
34
35
msgid "Common uses for :class:`Mock` objects include:"
35
- msgstr ""
36
+ msgstr ":class:`Mock` 物件的常見用法包含: "
36
37
37
38
#: ../../library/unittest.mock-examples.rst:34
38
39
msgid "Patching methods"
39
- msgstr ""
40
+ msgstr "Patching 方法 "
40
41
41
42
#: ../../library/unittest.mock-examples.rst:35
42
43
msgid "Recording method calls on objects"
43
- msgstr ""
44
+ msgstr "記錄在物件上的方法呼叫 "
44
45
45
46
#: ../../library/unittest.mock-examples.rst:37
46
47
msgid ""
47
48
"You might want to replace a method on an object to check that it is called "
48
49
"with the correct arguments by another part of the system:"
49
50
msgstr ""
51
+ "你可能會想要取代一個物件上的方法,以便檢查系統的另一部分是否使用正確的引數呼"
52
+ "叫它:"
50
53
51
54
#: ../../library/unittest.mock-examples.rst:45
52
55
msgid ""
53
56
"Once our mock has been used (``real.method`` in this example) it has methods "
54
57
"and attributes that allow you to make assertions about how it has been used."
55
58
msgstr ""
59
+ "一旦我們的 mock 已經被使用(例如在這個範例中的 ``real.method``),它就有了方"
60
+ "法和屬性,允許你對其使用方式進行 assertions (斷言)。"
56
61
57
62
#: ../../library/unittest.mock-examples.rst:50
58
63
msgid ""
59
64
"In most of these examples the :class:`Mock` and :class:`MagicMock` classes "
60
65
"are interchangeable. As the ``MagicMock`` is the more capable class it makes "
61
66
"a sensible one to use by default."
62
67
msgstr ""
68
+ "在大多數的範例中,:class:`Mock` 和 :class:`MagicMock` class(類別)是可以互換"
69
+ "的。不過由於 ``MagicMock`` 是功能更強大的類別,因此通常它是一個更好的選擇。"
63
70
64
71
#: ../../library/unittest.mock-examples.rst:54
65
72
msgid ""
@@ -68,12 +75,17 @@ msgid ""
68
75
"or :meth:`~Mock.assert_called_once_with` method to check that it was called "
69
76
"with the correct arguments."
70
77
msgstr ""
78
+ "一旦 mock 被呼叫,它的 :attr:`~Mock.called` 屬性將被設定為 ``True``。更重要的"
79
+ "是,我們可以使用 :meth:`~Mock.assert_called_with` 或 :meth:`~Mock."
80
+ "assert_called_once_with` 方法來檢查它是否被使用正確的引數來呼叫。"
71
81
72
82
#: ../../library/unittest.mock-examples.rst:59
73
83
msgid ""
74
84
"This example tests that calling ``ProductionClass().method`` results in a "
75
85
"call to the ``something`` method:"
76
86
msgstr ""
87
+ "這個範例測試呼叫 ``ProductionClass().method`` 是否導致對 ``something`` 方法的"
88
+ "呼叫:"
77
89
78
90
#: ../../library/unittest.mock-examples.rst:76
79
91
msgid "Mock for Method Calls on an Object"
0 commit comments