@@ -35,7 +35,7 @@ class ClipboardTestCase(ModuleStoreTestCase):
3535 Test Clipboard functionality
3636 """
3737
38- def test_empty_clipboard (self ):
38+ def test_empty_clipboard (self ) -> None :
3939 """
4040 When a user has no content on their clipboard, we get an empty 200 response
4141 """
@@ -70,7 +70,7 @@ def _setup_course(self):
7070
7171 return (course_key , client )
7272
73- def test_copy_video (self ):
73+ def test_copy_video (self ) -> None :
7474 """
7575 Test copying a video from the course, and retrieve it using the REST API
7676 """
@@ -103,7 +103,7 @@ def test_copy_video(self):
103103 # Now if we GET the clipboard again, the GET response should exactly equal the last POST response:
104104 assert client .get (CLIPBOARD_ENDPOINT ).json () == response_data
105105
106- def test_copy_video_python_get (self ):
106+ def test_copy_video_python_get (self ) -> None :
107107 """
108108 Test copying a video from the course, and retrieve it using the python API
109109 """
@@ -126,9 +126,10 @@ def test_copy_video_python_get(self):
126126 assert clipboard_data .content .display_name == "default"
127127 # Test the actual OLX in the clipboard:
128128 olx_data = python_api .get_staged_content_olx (clipboard_data .content .id )
129+ assert olx_data is not None
129130 self .assertXmlEqual (olx_data , SAMPLE_VIDEO_OLX )
130131
131- def test_copy_html (self ):
132+ def test_copy_html (self ) -> None :
132133 """
133134 Test copying an HTML XBlock from the course
134135 """
@@ -166,7 +167,7 @@ def test_copy_html(self):
166167 # Now if we GET the clipboard again, the GET response should exactly equal the last POST response:
167168 assert client .get (CLIPBOARD_ENDPOINT ).json () == response_data
168169
169- def test_copy_unit (self ):
170+ def test_copy_unit (self ) -> None :
170171 """
171172 Test copying a unit (vertical block) from the course
172173 """
@@ -242,7 +243,7 @@ def test_copy_unit(self):
242243 # Now if we GET the clipboard again, the GET response should exactly equal the last POST response:
243244 assert client .get (CLIPBOARD_ENDPOINT ).json () == response_data
244245
245- def test_copy_several_things (self ):
246+ def test_copy_several_things (self ) -> None :
246247 """
247248 Test that the clipboard only holds one thing at a time.
248249 """
@@ -275,7 +276,7 @@ def test_copy_several_things(self):
275276 # The OLX link from the video will no longer work:
276277 assert client .get (old_olx_url ).status_code == 404
277278
278- def test_copy_static_assets (self ):
279+ def test_copy_static_assets (self ) -> None :
279280 """
280281 Test copying an HTML from the course that references a static asset file.
281282 """
@@ -297,6 +298,7 @@ def test_copy_static_assets(self):
297298 response_data = response .json ()
298299 staged_content_id = cast (python_api .StagedContentID , response_data ["content" ]["id" ])
299300 olx_str = python_api .get_staged_content_olx (staged_content_id )
301+ assert olx_str is not None
300302 assert '<img src="/static/foo_bar.jpg" />' in olx_str
301303 static_assets = python_api .get_staged_content_static_files (staged_content_id )
302304
@@ -307,7 +309,7 @@ def test_copy_static_assets(self):
307309 data = None ,
308310 )]
309311
310- def test_copy_static_assets_nonexistent (self ):
312+ def test_copy_static_assets_nonexistent (self ) -> None :
311313 """
312314 Test copying a HTML block which references non-existent static assets.
313315 """
@@ -332,11 +334,12 @@ def test_copy_static_assets_nonexistent(self):
332334 response_data = response .json ()
333335 staged_content_id = response_data ["content" ]["id" ]
334336 olx_str = python_api .get_staged_content_olx (staged_content_id )
337+ assert olx_str is not None
335338 assert '<a href="/static/nonexistent1.jpg">' in olx_str
336339 static_assets = python_api .get_staged_content_static_files (staged_content_id )
337340 assert static_assets == []
338341
339- def test_no_course_permission (self ):
342+ def test_no_course_permission (self ) -> None :
340343 """
341344 Test that a user without read access cannot copy items in a course
342345 """
@@ -353,7 +356,7 @@ def test_no_course_permission(self):
353356 response = nonstaff_client .get (CLIPBOARD_ENDPOINT )
354357 assert response .json ()["content" ] is None
355358
356- def test_no_stealing_clipboard_content (self ):
359+ def test_no_stealing_clipboard_content (self ) -> None :
357360 """
358361 Test that a user cannot see another user's clipboard
359362 """
@@ -370,7 +373,7 @@ def test_no_stealing_clipboard_content(self):
370373 response = nonstaff_client .get (olx_url )
371374 assert response .status_code == 403
372375
373- def assertXmlEqual (self , xml_str_a : str , xml_str_b : str ):
376+ def assertXmlEqual (self , xml_str_a : str , xml_str_b : str ) -> None :
374377 """ Assert that the given XML strings are equal, ignoring attribute order and some whitespace variations. """
375378 a = ElementTree .canonicalize (xml_str_a , strip_text = True )
376379 b = ElementTree .canonicalize (xml_str_b , strip_text = True )
0 commit comments