Skip to content

Commit c87e81e

Browse files
committed
Fix mock calls in test cases
1 parent 46a4f71 commit c87e81e

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

readthedocs/rtd_tests/tests/test_core_utils.py

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from django_dynamic_fixture import get
77
from django.test import TestCase
8-
from django.test.utils import override_settings
98

109
from readthedocs.projects.models import Project
1110
from readthedocs.builds.models import Version
@@ -22,60 +21,58 @@ def setUp(self):
2221
def test_trigger_build_time_limit(self, update_docs):
2322
"""Pass of time limit"""
2423
trigger_build(project=self.project, version=self.version)
25-
update_docs().apply_async.assert_has_calls([
24+
update_docs().si.assert_has_calls([
2625
mock.call(
26+
self.project.pk,
2727
time_limit=720,
2828
soft_time_limit=600,
2929
queue=mock.ANY,
30-
kwargs={
31-
'pk': self.project.id,
32-
'force': False,
33-
'record': True,
34-
'build_pk': mock.ANY,
35-
'version_pk': self.version.id
36-
}
37-
)
30+
force=False,
31+
record=True,
32+
build_pk=mock.ANY,
33+
version_pk=self.version.id,
34+
),
3835
])
36+
update_docs().si().apply_async.assert_called()
3937

4038
@mock.patch('readthedocs.projects.tasks.UpdateDocsTask')
4139
def test_trigger_build_invalid_time_limit(self, update_docs):
4240
"""Time limit as string"""
4341
self.project.container_time_limit = '200s'
4442
trigger_build(project=self.project, version=self.version)
45-
update_docs().apply_async.assert_has_calls([
43+
update_docs().si.assert_has_calls([
4644
mock.call(
45+
self.project.pk,
4746
time_limit=720,
4847
soft_time_limit=600,
4948
queue=mock.ANY,
50-
kwargs={
51-
'pk': self.project.id,
52-
'force': False,
53-
'record': True,
54-
'build_pk': mock.ANY,
55-
'version_pk': self.version.id
56-
}
57-
)
49+
force=False,
50+
record=True,
51+
build_pk=mock.ANY,
52+
version_pk=self.version.id,
53+
),
5854
])
55+
update_docs().si().apply_async.assert_called()
5956

6057
@mock.patch('readthedocs.projects.tasks.UpdateDocsTask')
6158
def test_trigger_build_rounded_time_limit(self, update_docs):
6259
"""Time limit should round down"""
6360
self.project.container_time_limit = 3
6461
trigger_build(project=self.project, version=self.version)
65-
update_docs().apply_async.assert_has_calls([
62+
update_docs().si.assert_has_calls([
6663
mock.call(
67-
time_limit=3,
68-
soft_time_limit=3,
64+
self.project.pk,
65+
time_limit=720,
66+
soft_time_limit=600,
6967
queue=mock.ANY,
70-
kwargs={
71-
'pk': self.project.id,
72-
'force': False,
73-
'record': True,
74-
'build_pk': mock.ANY,
75-
'version_pk': self.version.id
76-
}
77-
)
68+
force=False,
69+
record=True,
70+
build_pk=mock.ANY,
71+
version_pk=self.version.id,
72+
),
7873
])
74+
update_docs().si().apply_async.assert_called()
75+
7976

8077
def test_slugify(self):
8178
"""Test additional slugify"""

0 commit comments

Comments
 (0)