@@ -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-10-20 00:03+0000\n "
11
- "PO-Revision-Date : 2023-11-23 21:46 +0800\n "
11
+ "PO-Revision-Date : 2023-12-04 21:31 +0800\n "
12
12
"
Last-Translator :
Adrian Liaw <[email protected] >\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
@@ -827,64 +827,80 @@ msgid ""
827
827
"class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so "
828
828
"you can specify a return value when it is fetched."
829
829
msgstr ""
830
+ "一個理應在類別上當成屬性或其他描述器的 mock。:class:`PropertyMock` 提供了 :"
831
+ "meth:`__get__` 和 :meth:`__set__` 方法,因此你可以在它被提取時指定回傳值。"
830
832
831
833
#: ../../library/unittest.mock.rst:827
832
834
msgid ""
833
835
"Fetching a :class:`PropertyMock` instance from an object calls the mock, "
834
836
"with no args. Setting it calls the mock with the value being set. ::"
835
837
msgstr ""
838
+ "從物件中提取 :class:`PropertyMock` 實例會不帶任何引數呼叫 mock。設定它則會用"
839
+ "設定的值來呼叫 mock: ::"
836
840
837
841
#: ../../library/unittest.mock.rst:848
838
842
msgid ""
839
843
"Because of the way mock attributes are stored you can't directly attach a :"
840
844
"class:`PropertyMock` to a mock object. Instead you can attach it to the mock "
841
845
"type object::"
842
846
msgstr ""
847
+ "由於 mock 屬性的儲存方式,你無法直接將 :class:`PropertyMock` 附加到 mock 物"
848
+ "件。但是你可以將其附加到 mock 型別的物件: ::"
843
849
844
850
#: ../../library/unittest.mock.rst:862
845
851
msgid ""
846
852
"An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object "
847
853
"will behave so the object is recognized as an async function, and the result "
848
854
"of a call is an awaitable."
849
855
msgstr ""
856
+ ":class:`MagicMock` 的非同步版本。:class:`AsyncMock` 物件的表現將被視為非同步"
857
+ "函式,並且呼叫的結果是一個可等待物件。"
850
858
851
859
#: ../../library/unittest.mock.rst:872
852
860
msgid ""
853
861
"The result of ``mock()`` is an async function which will have the outcome of "
854
862
"``side_effect`` or ``return_value`` after it has been awaited:"
855
863
msgstr ""
864
+ "``mock()`` 的結果是一個非同步函式,在它被等待後將具有 ``side_effect`` 或 "
865
+ "``return_value`` 的結果:"
856
866
857
867
#: ../../library/unittest.mock.rst:875
858
868
msgid ""
859
869
"if ``side_effect`` is a function, the async function will return the result "
860
870
"of that function,"
861
- msgstr ""
871
+ msgstr "如果 ``side_effect`` 是一個函式,非同步函式將回傳該函式的結果, "
862
872
863
873
#: ../../library/unittest.mock.rst:877
864
874
msgid ""
865
875
"if ``side_effect`` is an exception, the async function will raise the "
866
876
"exception,"
867
- msgstr ""
877
+ msgstr "如果 ``side_effect`` 是一個例外,則非同步函式將引發該例外, "
868
878
869
879
#: ../../library/unittest.mock.rst:879
870
880
msgid ""
871
881
"if ``side_effect`` is an iterable, the async function will return the next "
872
882
"value of the iterable, however, if the sequence of result is exhausted, "
873
883
"``StopAsyncIteration`` is raised immediately,"
874
884
msgstr ""
885
+ "如果 ``side_effect`` 是一個可疊代物件,非同步函式將回傳可疊代物件的下一個值,"
886
+ "但如果結果序列耗盡,將立即引發 ``StopAsyncIteration``,"
875
887
876
888
#: ../../library/unittest.mock.rst:882
877
889
msgid ""
878
890
"if ``side_effect`` is not defined, the async function will return the value "
879
891
"defined by ``return_value``, hence, by default, the async function returns a "
880
892
"new :class:`AsyncMock` object."
881
893
msgstr ""
894
+ "如果 ``side_effect`` 沒有被定義,非同步函式將回傳由 ``return_value`` 定義的"
895
+ "值,因此在預設情況下,非同步函式回傳一個新的 :class:`AsyncMock` 物件。"
882
896
883
897
#: ../../library/unittest.mock.rst:887
884
898
msgid ""
885
899
"Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async "
886
900
"function will result in a coroutine object being returned after calling."
887
901
msgstr ""
902
+ "將 :class:`Mock` 或 :class:`MagicMock` 的 *spec* 設定為非同步函式將導致在呼叫"
903
+ "後回傳一個協程物件。"
888
904
889
905
#: ../../library/unittest.mock.rst:899
890
906
msgid ""
@@ -895,81 +911,100 @@ msgid ""
895
911
"or :class:`Mock` (if the parent mock is :class:`Mock`). All asynchronous "
896
912
"functions will be :class:`AsyncMock`."
897
913
msgstr ""
914
+ "將 :class:`Mock`、:class:`MagicMock` 或 :class:`AsyncMock` 的 *spec* 設定為具"
915
+ "有同步和非同步函式的類別,會自動檢測同步函式並將其設定為 :class:"
916
+ "`MagicMock`\\ (如果上代 mock 為 :class:`AsyncMock` 或 :class:"
917
+ "`MagicMock`\\ )或 :class:`Mock`\\ (如果上代 mock 為 :class:`Mock`\\ )。所"
918
+ "有非同步函式將被設定為 :class:`AsyncMock`。"
898
919
899
920
#: ../../library/unittest.mock.rst:927
900
921
msgid ""
901
922
"Assert that the mock was awaited at least once. Note that this is separate "
902
923
"from the object having been called, the ``await`` keyword must be used:"
903
924
msgstr ""
925
+ "斷言 mock 至少被等待過一次。請注意這與物件是否被呼叫是分開的,``await`` 關鍵"
926
+ "字必須被使用:"
904
927
905
928
#: ../../library/unittest.mock.rst:946
906
929
msgid "Assert that the mock was awaited exactly once."
907
- msgstr ""
930
+ msgstr "斷言 mock 正好被等待了一次。 "
908
931
909
932
#: ../../library/unittest.mock.rst:962
910
933
msgid "Assert that the last await was with the specified arguments."
911
- msgstr ""
934
+ msgstr "斷言最後一次等待使用了指定的引數。 "
912
935
913
936
#: ../../library/unittest.mock.rst:979
914
937
msgid ""
915
938
"Assert that the mock was awaited exactly once and with the specified "
916
939
"arguments."
917
- msgstr ""
940
+ msgstr "斷言 mock 只被等待了一次並使用了指定的引數。 "
918
941
919
942
#: ../../library/unittest.mock.rst:996
920
943
msgid "Assert the mock has ever been awaited with the specified arguments."
921
- msgstr ""
944
+ msgstr "斷言 mock 曾經被使用指定的引數等待過。 "
922
945
923
946
#: ../../library/unittest.mock.rst:1012
924
947
msgid ""
925
948
"Assert the mock has been awaited with the specified calls. The :attr:"
926
949
"`await_args_list` list is checked for the awaits."
927
950
msgstr ""
951
+ "斷言 mock 已被使用指定的呼叫進行等待。:attr:`await_args_list` 串列將被檢查以"
952
+ "確認等待的內容。"
928
953
929
954
#: ../../library/unittest.mock.rst:1015
930
955
msgid ""
931
956
"If *any_order* is false then the awaits must be sequential. There can be "
932
957
"extra calls before or after the specified awaits."
933
958
msgstr ""
959
+ "如果 *any_order* 為 false,則等待必須按照順序。指定的等待之前或之後可以有額外"
960
+ "的呼叫。"
934
961
935
962
#: ../../library/unittest.mock.rst:1019
936
963
msgid ""
937
964
"If *any_order* is true then the awaits can be in any order, but they must "
938
965
"all appear in :attr:`await_args_list`."
939
966
msgstr ""
967
+ "如果 *any_order* 為 true,則等待可以以任何順序出現,但它們必須全部出現在 :"
968
+ "attr:`await_args_list` 中。"
940
969
941
970
#: ../../library/unittest.mock.rst:1039
942
971
msgid "Assert that the mock was never awaited."
943
- msgstr ""
972
+ msgstr "斷言 mock 從未被等待。 "
944
973
945
974
#: ../../library/unittest.mock.rst:1046
946
975
msgid ""
947
976
"See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:"
948
977
"`await_args` to None, and clears the :attr:`await_args_list`."
949
978
msgstr ""
979
+ "參見 :func:`Mock.reset_mock`。同時將 :attr:`await_count` 設定為 0,:attr:"
980
+ "`await_args` 設定為 None,並清除 :attr:`await_args_list`。"
950
981
951
982
#: ../../library/unittest.mock.rst:1051
952
983
msgid ""
953
984
"An integer keeping track of how many times the mock object has been awaited."
954
- msgstr ""
985
+ msgstr "一個整數,用來記錄 mock 物件已被等待的次數。 "
955
986
956
987
#: ../../library/unittest.mock.rst:1066
957
988
msgid ""
958
989
"This is either ``None`` (if the mock hasn’t been awaited), or the arguments "
959
990
"that the mock was last awaited with. Functions the same as :attr:`Mock."
960
991
"call_args`."
961
992
msgstr ""
993
+ "這可能是 ``None``\\ (如果 mock 尚未被等待),或者是上次等待 mock 時使用的引"
994
+ "數。與 :attr:`Mock.call_args` 的功能相同。"
962
995
963
996
#: ../../library/unittest.mock.rst:1084
964
997
msgid ""
965
998
"This is a list of all the awaits made to the mock object in sequence (so the "
966
999
"length of the list is the number of times it has been awaited). Before any "
967
1000
"awaits have been made it is an empty list."
968
1001
msgstr ""
1002
+ "這是一個按照順序記錄 mock 物件所有等待的串列(因此串列的長度表示該物件已被等"
1003
+ "待的次數)。在進行任何等待之前,此串列為空。"
969
1004
970
1005
#: ../../library/unittest.mock.rst:1103
971
1006
msgid "Calling"
972
- msgstr ""
1007
+ msgstr "呼叫 "
973
1008
974
1009
#: ../../library/unittest.mock.rst:1105
975
1010
msgid ""
0 commit comments