コード例 #1
0
def test_get_deployment_status_use_action_helper_force_completed(
        get_href, get_path, get_result):
    action = {
        'committed_rev_id': 'rev_id',
        'context_marker': 'markofcontext',
        'dag_status': 'ASDFJKL:',
        'id': 'action_id',
        'timestamp': 'my_timestamp',
        'user': '******'
    }
    expected_data = {
        'status': 'completed',
        'results': 'result',
        'context-marker': action['context_marker'],
        'action': action['id'],
        'document_url': 'href',
        'user': action['user'],
        'date': action['timestamp']
    }

    deployment_status = action_helper.get_deployment_status(action, True)
    assert deployment_status['status'] == expected_data['status']
    assert deployment_status['results'] == expected_data['results']
    assert (
        deployment_status['context-marker'] == expected_data['context-marker'])
    assert deployment_status['action'] == expected_data['action']
    assert deployment_status['document_url'] == expected_data['document_url']
    assert deployment_status['user'] == expected_data['user']
    assert deployment_status['date'] == expected_data['date']
    get_href.assert_called_once_with(action['committed_rev_id'])
    assert get_result.called
    assert get_path.called  # This means we created a DesignRefHelper object
コード例 #2
0
    def _get_status_and_revision(self):
        """Retrieve the deployment status information from the appropriate
        helper function

        :return: dict with the status of the deployment
        :return: revision_id of the action
        """
        action_info = self.xcom_puller.get_action_info()
        deployment_status = get_deployment_status(
            action_info,
            force_completed=self.force_completed)

        revision_id = action_info['committed_rev_id']

        return deployment_status, revision_id