"""Global test configuration and set of fixtures.""" from unittest.mock import MagicMock, Mock import pytest @pytest.fixture(autouse=True) def mock_swf_base(monkeypatch): """Mock all connections to SWF.""" mm = MagicMock(return_value=None) monkeypatch.setattr( 'boto.swf.layer2.SWFBase.__init__', mm) @pytest.fixture() def flow_mock(): """Flow object fixture.""" flow = Mock( flow_domain='flow_domain', flow_name='flow_name', flow_version='flow_version') flow.workflow_id_mock = 'test_workflow_id' flow.workflow_id.return_value = flow.workflow_id_mock return flow