2323 pip .main (['install' , 'mock' ])
2424 from mock import MagicMock , patch , call
2525
26- import mlx .jira_juggler as dut
26+ import mlx .jira_juggler . jira_juggler as dut
2727
2828try :
2929 from jira import JIRA
@@ -167,7 +167,7 @@ class TestJiraJuggler(unittest.TestCase):
167167 def SetUp (self ):
168168 '''SetUp is run before each test to provide clean working environment'''
169169
170- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
170+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
171171 def test_empty_query_result (self , jira_mock ):
172172 '''Test for Jira not returning any task on the given query'''
173173 jira_mock_object = MagicMock (spec = JIRA )
@@ -179,7 +179,7 @@ def test_empty_query_result(self, jira_mock):
179179 juggler .juggle ()
180180 jira_mock_object .search_issues .assert_called_once_with (self .QUERY , maxResults = dut .JIRA_PAGE_SIZE , startAt = 0 , expand = 'changelog' )
181181
182- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
182+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
183183 def test_single_task_happy (self , jira_mock ):
184184 '''Test for simple happy flow: single task is returned by Jira Server'''
185185 jira_mock_object = MagicMock (spec = JIRA )
@@ -203,7 +203,7 @@ def test_single_task_happy(self, jira_mock):
203203 self .assertEqual (self .ESTIMATE1 / self .SECS_PER_DAY , issues [0 ].properties ['effort' ].value )
204204 self .assertEqual (self .DEPENDS1 , issues [0 ].properties ['depends' ].value )
205205
206- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
206+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
207207 def test_single_task_email_happy (self , jira_mock ):
208208 '''Test for simple happy flow: single task is returned by Jira Cloud'''
209209 jira_mock_object = MagicMock (spec = JIRA )
@@ -228,7 +228,7 @@ def test_single_task_email_happy(self, jira_mock):
228228 self .assertEqual (self .ESTIMATE1 / self .SECS_PER_DAY , issues [0 ].properties ['effort' ].value )
229229 self .assertEqual (self .DEPENDS1 , issues [0 ].properties ['depends' ].value )
230230
231- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
231+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
232232 def test_single_task_email_hidden (self , jira_mock ):
233233 '''Test for error logging when user has restricted email visibility in Jira Cloud'''
234234 jira_mock_object = MagicMock (spec = JIRA )
@@ -254,7 +254,7 @@ def test_single_task_email_hidden(self, jira_mock):
254254 self .assertEqual (self .ESTIMATE1 / self .SECS_PER_DAY , issues [0 ].properties ['effort' ].value )
255255 self .assertEqual (self .DEPENDS1 , issues [0 ].properties ['depends' ].value )
256256
257- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
257+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
258258 def test_single_task_minimal (self , jira_mock ):
259259 '''Test for minimal happy flow: single task with minimal content is returned by Jira
260260
@@ -276,7 +276,7 @@ def test_single_task_minimal(self, jira_mock):
276276 self .assertEqual (self .SUMMARY1 , issues [0 ].summary )
277277 self .assertEqual (dut .JugglerTaskEffort .DEFAULT_VALUE , issues [0 ].properties ['effort' ].value )
278278
279- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
279+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
280280 def test_estimate_too_low (self , jira_mock ):
281281 '''Test for correcting an estimate which is too low'''
282282 jira_mock_object = MagicMock (spec = JIRA )
@@ -296,7 +296,7 @@ def test_estimate_too_low(self, jira_mock):
296296 self .assertEqual (self .SUMMARY1 , issues [0 ].summary )
297297 self .assertEqual (dut .JugglerTaskEffort .MINIMAL_VALUE , issues [0 ].properties ['effort' ].value )
298298
299- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
299+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
300300 def test_broken_depends (self , jira_mock ):
301301 '''Test for removing a broken link to a dependant task'''
302302 jira_mock_object = MagicMock (spec = JIRA )
@@ -317,7 +317,7 @@ def test_broken_depends(self, jira_mock):
317317 self .assertEqual (self .SUMMARY1 , issues [0 ].summary )
318318 self .assertEqual ([], issues [0 ].properties ['depends' ].value )
319319
320- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
320+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
321321 def test_task_depends (self , jira_mock ):
322322 '''Test for dual happy flow: one task depends on the other'''
323323 jira_mock_object = MagicMock (spec = JIRA )
@@ -352,7 +352,7 @@ def test_task_depends(self, jira_mock):
352352 self .assertEqual (self .ESTIMATE2 / self .SECS_PER_DAY , issues [1 ].properties ['effort' ].value )
353353 self .assertEqual (self .DEPENDS2 , issues [1 ].properties ['depends' ].value )
354354
355- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
355+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
356356 def test_task_double_depends (self , jira_mock ):
357357 '''Test for extended happy flow: one task depends on two others'''
358358 jira_mock_object = MagicMock (spec = JIRA )
@@ -397,7 +397,7 @@ def test_task_double_depends(self, jira_mock):
397397 self .assertEqual (self .ESTIMATE3 / self .SECS_PER_DAY , issues [2 ].properties ['effort' ].value )
398398 self .assertEqual (self .DEPENDS3 , issues [2 ].properties ['depends' ].value )
399399
400- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
400+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
401401 def test_resolved_task (self , jira_mock ):
402402 '''Test that the last assignee in the Analyzed state is used and the Time Spent is used as effort
403403 Test that the most recent transition to the Approved/Resolved state is used to mark the end'''
@@ -465,7 +465,7 @@ def test_resolved_task(self, jira_mock):
465465 self .assertEqual (self .ESTIMATE2 / self .SECS_PER_DAY , issues [0 ].properties ['effort' ].value )
466466 self .assertEqual ('2022-05-25 14:07:11.974000+02:00' , str (issues [0 ].resolved_at_date ))
467467
468- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
468+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
469469 def test_closed_task (self , jira_mock ):
470470 '''
471471 Test that a change of assignee after Resolved status has no effect and that the original time estimate is
@@ -506,7 +506,7 @@ def test_closed_task(self, jira_mock):
506506 self .assertEqual (self .ASSIGNEE1 , issues [0 ].properties ['allocate' ].value )
507507 self .assertEqual (self .ESTIMATE1 / self .SECS_PER_DAY , issues [0 ].properties ['effort' ].value )
508508
509- @patch ('mlx.jira_juggler.JIRA' , autospec = True )
509+ @patch ('mlx.jira_juggler.jira_juggler. JIRA' , autospec = True )
510510 def test_depend_on_preceding (self , jira_mock ):
511511 '''Test --depends-on-preceding, --weeklymax and --current-date options'''
512512 jira_mock_object = MagicMock (spec = JIRA )
0 commit comments