@@ -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-07-22 00:04+0000\n "
11
- "PO-Revision-Date : 2023-09-05 00:58 +0800\n "
11
+ "PO-Revision-Date : 2023-09-07 23:26 +0800\n "
12
12
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -315,23 +315,29 @@ msgid ""
315
315
"Alternatively *side_effect* can be an exception class or instance. In this "
316
316
"case the exception will be raised when the mock is called."
317
317
msgstr ""
318
+ "*side_effect* 也可以是一個例外的類別或實例。在這種情況下,當呼叫 mock 時,該"
319
+ "例外將被引發。"
318
320
319
321
#: ../../library/unittest.mock.rst:257
320
322
msgid ""
321
323
"If *side_effect* is an iterable then each call to the mock will return the "
322
324
"next value from the iterable."
323
325
msgstr ""
326
+ "如果 *side_effect* 是一個可疊代物件,那麼對 mock 的每次呼叫將回傳可疊代物件中"
327
+ "的下一個值。"
324
328
325
329
#: ../../library/unittest.mock.rst:260
326
330
msgid "A *side_effect* can be cleared by setting it to ``None``."
327
- msgstr ""
331
+ msgstr "*side_effect* 可以通過將其設置為 ``None`` 來清除。 "
328
332
329
333
#: ../../library/unittest.mock.rst:262
330
334
msgid ""
331
335
"*return_value*: The value returned when the mock is called. By default this "
332
336
"is a new Mock (created on first access). See the :attr:`return_value` "
333
337
"attribute."
334
338
msgstr ""
339
+ "*return_value*:當呼叫 mock 時回傳的值。默認情況下,這是一個新的 Mock(在首次"
340
+ "存取時建立)。參見 :attr:`return_value` 屬性。"
335
341
336
342
#: ../../library/unittest.mock.rst:266
337
343
msgid ""
@@ -340,6 +346,9 @@ msgid ""
340
346
"`AttributeError`. Passing ``unsafe=True`` will allow access to these "
341
347
"attributes."
342
348
msgstr ""
349
+ "*unsafe*:默認情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 "
350
+ "*assrt* 開頭的屬性將引發 :exc:`AttributeError`。如果傳遞 ``unsafe=True``\\ ,"
351
+ "將會允許存取這些屬性。"
343
352
344
353
#: ../../library/unittest.mock.rst:273
345
354
msgid ""
@@ -350,49 +359,59 @@ msgid ""
350
359
"to access an attribute that doesn't exist will raise an :exc:"
351
360
"`AttributeError`)."
352
361
msgstr ""
362
+ "*wraps*:被 mock 物件包裹的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將"
363
+ "通過被包裹的物件(返回真實結果)。存取 mock 的屬性將會返回一個 Mock 物件,該"
364
+ "物件包裹了被包裹物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:"
365
+ "`AttributeError`\\ )。"
353
366
354
367
#: ../../library/unittest.mock.rst:280
355
368
msgid ""
356
369
"If the mock has an explicit *return_value* set then calls are not passed to "
357
370
"the wrapped object and the *return_value* is returned instead."
358
371
msgstr ""
372
+ "如果 mock 已經明確設定了 *return_value*,那麼呼叫並不會被傳遞到被包裹的物件,"
373
+ "而是回傳已設定好的 *return_value*。"
359
374
360
375
#: ../../library/unittest.mock.rst:283
361
376
msgid ""
362
377
"*name*: If the mock has a name then it will be used in the repr of the mock. "
363
378
"This can be useful for debugging. The name is propagated to child mocks."
364
379
msgstr ""
380
+ "*name*:如果 mock 有一個名稱,那麼它會被用於 mock 的 repr(表示形式)。這對於"
381
+ "除錯很有用。此名稱將被傳播到子 mocks。"
365
382
366
383
#: ../../library/unittest.mock.rst:287
367
384
msgid ""
368
385
"Mocks can also be called with arbitrary keyword arguments. These will be "
369
386
"used to set attributes on the mock after it is created. See the :meth:"
370
387
"`configure_mock` method for details."
371
388
msgstr ""
389
+ "Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在創建 mock 之後用"
390
+ "於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。"
372
391
373
392
#: ../../library/unittest.mock.rst:293
374
393
msgid "Assert that the mock was called at least once."
375
- msgstr ""
394
+ msgstr "確認 mock 至少被呼叫一次。 "
376
395
377
396
#: ../../library/unittest.mock.rst:304
378
397
msgid "Assert that the mock was called exactly once."
379
- msgstr ""
398
+ msgstr "確認 mock 只被呼叫一次。 "
380
399
381
400
#: ../../library/unittest.mock.rst:322
382
401
msgid ""
383
402
"This method is a convenient way of asserting that the last call has been "
384
403
"made in a particular way:"
385
- msgstr ""
404
+ msgstr "這個方法是一個便利的方式,用來斷言最後一次呼叫是以特定方式進行的: "
386
405
387
406
#: ../../library/unittest.mock.rst:332
388
407
msgid ""
389
408
"Assert that the mock was called exactly once and that call was with the "
390
409
"specified arguments."
391
- msgstr ""
410
+ msgstr "確認 mock 只被呼叫一次,且該次呼叫使用了指定的引數。 "
392
411
393
412
#: ../../library/unittest.mock.rst:347
394
413
msgid "assert the mock has been called with the specified arguments."
395
- msgstr ""
414
+ msgstr "斷言 mock 已經被使用指定的引數呼叫。 "
396
415
397
416
#: ../../library/unittest.mock.rst:349
398
417
msgid ""
@@ -401,24 +420,33 @@ msgid ""
401
420
"the call is the most recent one, and in the case of :meth:"
402
421
"`assert_called_once_with` it must also be the only call."
403
422
msgstr ""
423
+ "這個斷言在 mock 曾經被呼叫過時通過,不同於 :meth:`assert_called_with` 和 :"
424
+ "meth:`assert_called_once_with`,他們針對的是最近的一次的呼叫,而且對於 :meth:"
425
+ "`assert_called_once_with`,最近一次的呼叫還必須也是唯一一次的呼叫。"
404
426
405
427
#: ../../library/unittest.mock.rst:362
406
428
msgid ""
407
429
"assert the mock has been called with the specified calls. The :attr:"
408
430
"`mock_calls` list is checked for the calls."
409
431
msgstr ""
432
+ "斷言 mock 已經使用指定的呼叫所呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的"
433
+ "呼叫。"
410
434
411
435
#: ../../library/unittest.mock.rst:365
412
436
msgid ""
413
437
"If *any_order* is false then the calls must be sequential. There can be "
414
438
"extra calls before or after the specified calls."
415
439
msgstr ""
440
+ "如果 *any_order* 為 false,那麼這些呼叫必須按照順序。在指定的呼叫之前或之後可"
441
+ "以有額外的呼叫。"
416
442
417
443
#: ../../library/unittest.mock.rst:369
418
444
msgid ""
419
445
"If *any_order* is true then the calls can be in any order, but they must all "
420
446
"appear in :attr:`mock_calls`."
421
447
msgstr ""
448
+ "如果 *any_order* 為 true,那麼這些乎醬可以以任何順序出現,但它們必須全部出現"
449
+ "在 :attr:`mock_calls` 中。"
422
450
423
451
#: ../../library/unittest.mock.rst:384
424
452
msgid "Assert the mock was never called."
0 commit comments