Skip to content

Commit fc854f4

Browse files
committed
Fix tests
Signed-off-by: Yves Bastide <yves@botify.com>
1 parent 6c454da commit fc854f4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tests/test_swf/models/test_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ def test_workflow_type_changes_with_identical_workflow_type(self):
187187
self.assertLength(diffs, 0)
188188

189189
def test_save_already_existing_type(self):
190-
with patch.object(self.wt.connection, 'register_workflow_type') as mock:
190+
with patch.object(self.wt, 'custom_register_workflow_type') as mock:
191191
with self.assertRaises(AlreadyExistsError):
192192
mock.side_effect = SWFTypeAlreadyExistsError(400, "mocked exception")
193193
self.wt.save()
194194

195195
def test_save_with_response_error(self):
196-
with patch.object(self.wt.connection, 'register_workflow_type') as mock:
196+
with patch.object(self.wt, 'custom_register_workflow_type') as mock:
197197
with self.assertRaises(DoesNotExistError):
198198
mock.side_effect = SWFResponseError(
199199
400,

tests/test_swf/querysets/test_workflow.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
WorkflowExecutionQuerySet
1515
from swf.utils import datetime_timestamp, past_day
1616

17-
from ..mocks.workflow import mock_describe_workflow_type,\
17+
from tests.test_swf.mocks.workflow import mock_describe_workflow_type,\
1818
mock_list_workflow_types,\
1919
mock_list_open_workflow_executions,\
2020
mock_list_closed_workflow_executions
@@ -110,7 +110,7 @@ def test_get_or_create_non_existent_workflow_type(self):
110110
with patch.object(Layer1, 'describe_workflow_type') as mock:
111111
mock.side_effect = DoesNotExistError("Mocked exception")
112112

113-
with patch.object(Layer1, 'register_workflow_type', mock_describe_workflow_type):
113+
with patch.object(WorkflowType, 'custom_register_workflow_type', mock_describe_workflow_type):
114114
workflow_type = self.wtq.get_or_create("TestDomain", "testversion")
115115

116116
self.assertIsInstance(workflow_type, WorkflowType)
@@ -145,9 +145,8 @@ def test_filter_with_registered_status(self):
145145
self.assertEqual(wt.status, REGISTERED)
146146

147147
def test_create_workflow_type(self):
148-
with patch.object(Layer1, 'register_workflow_type'):
148+
with patch.object(WorkflowType, 'custom_register_workflow_type'):
149149
new_wt = self.wtq.create(
150-
self.domain,
151150
"TestWorkflowType",
152151
"0.test",
153152
)

0 commit comments

Comments
 (0)