@@ -6,56 +6,66 @@ msgstr ""
6
6
"Project-Id-Version : Python 3.6\n "
7
7
"Report-Msgid-Bugs-To : \n "
8
8
"POT-Creation-Date : 2019-10-09 17:54+0200\n "
9
- "PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE\n "
10
- "Last-Translator : FULL NAME <EMAIL@ADDRESS>\n "
9
+ "PO-Revision-Date : 2019-12-01 23:32+0100\n "
11
10
"
Language-Team :
FRENCH <[email protected] >\n "
12
11
"Language : fr\n "
13
12
"MIME-Version : 1.0\n "
14
13
"Content-Type : text/plain; charset=UTF-8\n "
15
14
"Content-Transfer-Encoding : 8bit\n "
15
+ "Last-Translator : \n "
16
+ "X-Generator : Poedit 2.2.1\n "
16
17
17
18
#: ../Doc/library/unittest.mock-examples.rst:2
18
19
msgid ":mod:`unittest.mock` --- getting started"
19
20
msgstr ""
20
21
21
22
#: ../Doc/library/unittest.mock-examples.rst:27
22
23
msgid "Using Mock"
23
- msgstr ""
24
+ msgstr "Utilisation de Mock ou l'art de singer "
24
25
25
26
#: ../Doc/library/unittest.mock-examples.rst:30
26
27
msgid "Mock Patching Methods"
27
- msgstr ""
28
+ msgstr "Simulation des méthodes "
28
29
29
30
#: ../Doc/library/unittest.mock-examples.rst:32
30
31
msgid "Common uses for :class:`Mock` objects include:"
31
- msgstr ""
32
+ msgstr "Usages courant de :class:`Mock` : "
32
33
33
34
#: ../Doc/library/unittest.mock-examples.rst:34
34
35
msgid "Patching methods"
35
- msgstr ""
36
+ msgstr "Substitution des méthodes "
36
37
37
38
#: ../Doc/library/unittest.mock-examples.rst:35
38
39
msgid "Recording method calls on objects"
39
- msgstr ""
40
+ msgstr "Enregistrement des appels faits sur les objets "
40
41
41
42
#: ../Doc/library/unittest.mock-examples.rst:37
42
43
msgid ""
43
44
"You might want to replace a method on an object to check that it is called "
44
45
"with the correct arguments by another part of the system:"
45
46
msgstr ""
47
+ "On peut remplacer une méthode sur un objet pour contrôler qu'elle est bien "
48
+ "appelée avec le nombre correct d'arguments :"
46
49
47
50
#: ../Doc/library/unittest.mock-examples.rst:45
48
51
msgid ""
49
52
"Once our mock has been used (``real.method`` in this example) it has methods "
50
53
"and attributes that allow you to make assertions about how it has been used."
51
54
msgstr ""
55
+ "Une fois notre objet simulacre appelé (via ``real.method`` dans notre "
56
+ "exemple), il fournit des méthodes et attributs permettant de valider comment "
57
+ "il a été appelé."
52
58
53
59
#: ../Doc/library/unittest.mock-examples.rst:50
54
60
msgid ""
55
61
"In most of these examples the :class:`Mock` and :class:`MagicMock` classes "
56
62
"are interchangeable. As the ``MagicMock`` is the more capable class it makes "
57
63
"a sensible one to use by default."
58
64
msgstr ""
65
+ "Dans la majeure partie des exemples donnés ici, les classes :class:`Mock` "
66
+ "et :class:`MagicMock` sont interchangeables. Étant donné que ``MagicMock`` "
67
+ "est la classe la plus puissante des deux, cela fait sens de l'utiliser par "
68
+ "défaut."
59
69
60
70
#: ../Doc/library/unittest.mock-examples.rst:54
61
71
msgid ""
@@ -64,16 +74,22 @@ msgid ""
64
74
"or :meth:`~Mock.assert_called_once_with` method to check that it was called "
65
75
"with the correct arguments."
66
76
msgstr ""
77
+ "Une fois l'objet Mock appelé, son attribut :attr:`~Mock.called` est défini à "
78
+ "``True``. Qui plus est, nous pouvons utiliser les méthodes :meth:`~Mock."
79
+ "assert_called_with` ou :meth:`~Mock.assert_called_once_with` pour contrôler "
80
+ "qu'il a été appelé avec les bons arguments."
67
81
68
82
#: ../Doc/library/unittest.mock-examples.rst:59
69
83
msgid ""
70
84
"This example tests that calling ``ProductionClass().method`` results in a "
71
85
"call to the ``something`` method:"
72
86
msgstr ""
87
+ "Cet exemple teste que l'appel de la méthode ``ProductionClass().method`` "
88
+ "implique bien celui de la méthode ``something`` :"
73
89
74
90
#: ../Doc/library/unittest.mock-examples.rst:76
75
91
msgid "Mock for Method Calls on an Object"
76
- msgstr ""
92
+ msgstr "S'assurer de la bonne utilisation d'un objet "
77
93
78
94
#: ../Doc/library/unittest.mock-examples.rst:78
79
95
msgid ""
@@ -82,18 +98,27 @@ msgid ""
82
98
"method (or some part of the system under test) and then check that it is "
83
99
"used in the correct way."
84
100
msgstr ""
101
+ "Dans l'exemple précédent, nous avons directement remplacé une méthode par un "
102
+ "objet (afin de valider que l'appel était correct). Une autre façon de faire "
103
+ "est de passer un objet Mock en argument d'une méthode (ou de tout autre "
104
+ "partie du code à tester) et ensuite de contrôler que notre objet a été "
105
+ "utilisé de la façon attendue."
85
106
86
107
#: ../Doc/library/unittest.mock-examples.rst:83
87
108
msgid ""
88
109
"The simple ``ProductionClass`` below has a ``closer`` method. If it is "
89
110
"called with an object then it calls ``close`` on it."
90
111
msgstr ""
112
+ "Ci-dessous, ``ProductionClass`` dispose d'une méthode ``closer``. Si on "
113
+ "l'appelle avec un objet, alors elle appelle la méthode ``close`` dessus."
91
114
92
115
#: ../Doc/library/unittest.mock-examples.rst:91
93
116
msgid ""
94
117
"So to test it we need to pass in an object with a ``close`` method and check "
95
118
"that it was called correctly."
96
119
msgstr ""
120
+ "Ainsi, pour tester cette classe, nous devons lui passer un objet ayant une "
121
+ "méthode ``close``, puis vérifier qu'elle a bien été appelée."
97
122
98
123
#: ../Doc/library/unittest.mock-examples.rst:99
99
124
msgid ""
@@ -102,10 +127,15 @@ msgid ""
102
127
"accessing it in the test will create it, but :meth:`~Mock."
103
128
"assert_called_with` will raise a failure exception."
104
129
msgstr ""
130
+ "En fait, nous n'avons pas à nous soucier de fournir la méthode ``close`` "
131
+ "dans notre objet « simulé ». Le simple fait d'accéder à la méthode ``close`` "
132
+ "l'a crée. Si par contre la méthode ``close`` n'a pas été appelée alors, bien "
133
+ "que le test la créée en y accédant, :meth:`~Mock.assert_called_with` lèvera "
134
+ "une exception."
105
135
106
136
#: ../Doc/library/unittest.mock-examples.rst:106
107
137
msgid "Mocking Classes"
108
- msgstr ""
138
+ msgstr "Simulation des classes "
109
139
110
140
#: ../Doc/library/unittest.mock-examples.rst:108
111
141
msgid ""
@@ -114,6 +144,11 @@ msgid ""
114
144
"Instances are created by *calling the class*. This means you access the "
115
145
"\" mock instance\" by looking at the return value of the mocked class."
116
146
msgstr ""
147
+ "Un cas d'utilisation courant consiste à émuler les classes instanciées par "
148
+ "le code que nous testons. Quand on *patch* une classe, alors cette classe "
149
+ "est remplacée par un objet *mock*. Les instances de la classe étant créées "
150
+ "en *appelant la classe*, on accède à « l'instance *mock* » via la valeur de "
151
+ "retour de la classe émulée."
117
152
118
153
#: ../Doc/library/unittest.mock-examples.rst:113
119
154
msgid ""
@@ -341,9 +376,8 @@ msgid ""
341
376
msgstr ""
342
377
343
378
#: ../Doc/library/unittest.mock-examples.rst:388
344
- #, fuzzy
345
379
msgid "``patch.object``::"
346
- msgstr "``patch.object``:"
380
+ msgstr "``patch.object`` : :"
347
381
348
382
#: ../Doc/library/unittest.mock-examples.rst:405
349
383
msgid ""
0 commit comments