def step_paasta_stop_when(context): fake_args = mock.MagicMock( clusters='test_cluster', instances='test_instance', soa_dir='fake_soa_configs', service='fake_deployments_json_service', deploy_group=None, verify_image=False, ) context.force_bounce_timestamp = format_timestamp(datetime.utcnow()) with mock.patch( 'paasta_tools.cli.cmds.start_stop_restart.utils.get_git_url', autospec=True, return_value=context.test_git_repo_dir, ), mock.patch( 'paasta_tools.utils.format_timestamp', autospec=True, return_value=context.force_bounce_timestamp, ), mock.patch( 'paasta_tools.cli.cmds.start_stop_restart.apply_args_filters', autospec=True, return_value={ fake_args.clusters: { fake_args.service: [fake_args.instances] } }, ): try: paasta_stop(fake_args) except SystemExit: pass
def step_paasta_stop_when(context): fake_args = mock.MagicMock( clusters="test_cluster", instances="test_instance", soa_dir="fake_soa_configs", service="fake_deployments_json_service", ) context.force_bounce_timestamp = format_timestamp(datetime.utcnow()) with contextlib.nested( mock.patch( "paasta_tools.cli.cmds.start_stop_restart.utils.get_git_url", autospec=True, return_value=context.test_git_repo_dir, ), mock.patch("paasta_tools.utils.format_timestamp", autospec=True, return_value=context.force_bounce_timestamp), ) as (mock_get_git_url, mock_get_timestamp): try: paasta_stop(fake_args) except SystemExit: pass
def step_paasta_stop_when(context): fake_args = mock.MagicMock( cluster='test_cluster', instance='test_instance', soa_dir='fake_soa_configs', service='fake_deployments_json_service', ) context.force_bounce_timestamp = format_timestamp(datetime.utcnow()) with contextlib.nested( mock.patch('paasta_tools.cli.cmds.start_stop_restart.utils.get_git_url', autospec=True, return_value=context.test_git_repo_dir), mock.patch('paasta_tools.utils.format_timestamp', autospec=True, return_value=context.force_bounce_timestamp), ) as ( mock_get_git_url, mock_get_timestamp, ): try: paasta_stop(fake_args) except SystemExit: pass