@@ -118,6 +118,7 @@ def test_customize_test_creates_with_multiple_platforms(self, mock_user, mock_re
118
118
def test_customize_test_creates_with_select_arr (self , mock_user , mock_repo ):
119
119
"""Test customize test creation with commits list."""
120
120
from flask import g
121
+ from github .Commit import Commit
121
122
122
123
import mod_customized .controllers
123
124
reload (mod_customized .controllers )
@@ -128,14 +129,17 @@ def test_customize_test_creates_with_select_arr(self, mock_user, mock_repo):
128
129
for i in range (num_commits ):
129
130
commit_hash = self .create_random_string ()
130
131
url = f"https://github.com/{ return_git_user ()} /{ g .github ['repository' ]} /commit/{ commit_hash } "
131
- commits .append ({'html_url' : url , 'sha' : commit_hash })
132
+ new_commit = mock .MagicMock (Commit )
133
+ new_commit .sha = commit_hash
134
+ new_commit .html_url = url
135
+ commits .append (new_commit )
132
136
with self .app .test_client () as c :
133
137
c .post ('/account/login' , data = self .create_login_form_data (self .user .email , self .user .password ))
134
138
135
139
mock_repo .return_value .get_commits .return_value = commits
136
140
response = c .get ('/custom/' )
137
141
for commit in commits :
138
- self .assertIn (commit [ ' sha' ] , str (response .data ))
142
+ self .assertIn (commit . sha , str (response .data ))
139
143
140
144
def test_customize_regression_tests_load (self , mock_user , mock_repo ):
141
145
"""Test loading of the regression tests."""
0 commit comments