@@ -66,6 +66,11 @@ def test_edit_comment(self):
66
66
with pytest .raises (github3 .AuthenticationFailed ):
67
67
self .instance .edit ()
68
68
69
+ def test_lock (self ):
70
+ """Verify that locking an issue requires authentication."""
71
+ with pytest .raises (github3 .AuthenticationFailed ):
72
+ self .instance .lock ()
73
+
69
74
def test_remove_all_labels (self ):
70
75
"""Verify that removing all labels requires authentication."""
71
76
with pytest .raises (github3 .AuthenticationFailed ):
@@ -81,6 +86,11 @@ def test_reopen(self):
81
86
with pytest .raises (github3 .AuthenticationFailed ):
82
87
self .instance .reopen ()
83
88
89
+ def test_unlock (self ):
90
+ """Verify that unlocking an issue requires authentication."""
91
+ with pytest .raises (github3 .AuthenticationFailed ):
92
+ self .instance .unlock ()
93
+
84
94
85
95
class TestIssue (helper .UnitHelper ):
86
96
@@ -156,6 +166,15 @@ def test_create_comment_required_body(self):
156
166
self .instance .create_comment (body = '' )
157
167
assert self .session .post .called is False
158
168
169
+ def test_create_lock (self ):
170
+ """Verify the request for removing a lock from an issue."""
171
+ self .instance .lock ()
172
+
173
+ self .session .put .assert_called_once_with (
174
+ url_for ('lock' ),
175
+ headers = {'Accept' : 'application/vnd.github.the-key-preview+json' }
176
+ )
177
+
159
178
def test_comment_positive_id (self ):
160
179
"""Verify the request for retrieving an issue comment."""
161
180
self .instance .comment (- 1 )
@@ -267,6 +286,15 @@ def test_remove_label(self):
267
286
url_for ('labels/enhancement' )
268
287
)
269
288
289
+ def test_remove_lock (self ):
290
+ """Verify the request for removing a lock from an issue."""
291
+ self .instance .unlock ()
292
+
293
+ self .session .delete .assert_called_once_with (
294
+ url_for ('lock' ),
295
+ headers = {'Accept' : 'application/vnd.github.the-key-preview+json' }
296
+ )
297
+
270
298
def test_reopen (self ):
271
299
"""Test the request for reopening an issue."""
272
300
labels = [str (label ) for label in self .instance .original_labels ]
0 commit comments