@@ -21,7 +21,7 @@ def encode(payload: dict, _: str, algorithm: str, *args, **kwargs) -> str:
21
21
"""
22
22
Intercept the encode method.
23
23
24
- It is performed with an algorithm which does not require a PEM key, as it may
24
+ The result is encoded with an algorithm which does not require a PEM key, as it may
25
25
not be available in testing environments.
26
26
"""
27
27
self .assertEqual ("RS256" , algorithm , "The GitHub App JWT must be signed using RS256." )
@@ -39,10 +39,11 @@ def encode(payload: dict, _: str, algorithm: str, *args, **kwargs) -> str:
39
39
self .assertLess (decoded ["exp" ], (datetime .datetime .now () + delta ).timestamp ())
40
40
41
41
42
- class WaitForTests (unittest .TestCase ):
42
+ class CheckRunTests (unittest .TestCase ):
43
43
"""Tests the check_run_status utility."""
44
44
45
45
def test_completed_run (self ):
46
+ """Test that an already completed run returns the correct URL."""
46
47
final_url = "some_url_string_1234"
47
48
48
49
result = github_utils .check_run_status ({
@@ -245,20 +246,17 @@ def test_valid(self):
245
246
class GitHubArtifactViewTests (django .test .TestCase ):
246
247
"""Test the GitHub artifact fetch API view."""
247
248
248
- @classmethod
249
- def setUpClass (cls ):
250
- super ().setUpClass ()
251
-
252
- cls .kwargs = {
249
+ def setUp (self ):
250
+ self .kwargs = {
253
251
"owner" : "test_owner" ,
254
252
"repo" : "test_repo" ,
255
253
"sha" : "test_sha" ,
256
254
"action_name" : "test_action" ,
257
255
"artifact_name" : "test_artifact" ,
258
256
}
259
- cls .url = reverse ("api:github-artifacts" , kwargs = cls .kwargs )
257
+ self .url = reverse ("api:github-artifacts" , kwargs = self .kwargs )
260
258
261
- def test_successful (self , artifact_mock : mock .Mock ):
259
+ def test_correct_artifact (self , artifact_mock : mock .Mock ):
262
260
"""Test a proper response is returned with proper input."""
263
261
artifact_mock .return_value = "final download url"
264
262
result = self .client .get (self .url )
0 commit comments